To change the selection color of the listbox you can use for example:
- Code: Select all
application.putClientProperty('List.selectionBackground', new Packages.javax.swing.plaf.ColorUIResource(java.awt.Color.RED))
application.putClientProperty('List.selectionBackground', new Packages.javax.swing.plaf.ColorUIResource(java.awt.Color.RED))
Andrei Costescu wrote:Nice.
It didn't occur to me that it can be customized at swing level.
application.putClientProperty('List.selectionForeground', new [code]Packages.javax.swing.plaf.ColorUIResource[/code](java.awt.Color.decode('#ff000')));
application.putClientProperty('List.evenRowBackgroundPainter', new Packages.javax.swing.plaf.ColorUIResource(java.awt.Color.decode('#ff0000')));
application.putClientProperty('List.font', new Packages.javax.swing.plaf.FontUIResource('Tahoma', 0, 11));
/**
* Lists supported l&f specific UIManager properties. (can be used to customize a bit smart client's look and feel)
*
* @param {JSEvent} event the event that triggered the action
*
* @properties={typeid:24,uuid:"ED567DF9-DDF1-49AD-9CA6-4A361013FBF4"}
*/
function listUIManagerProperties(event) {
var defaults = Packages.javax.swing.UIManager.getDefaults();
application.output(defaults.size()+ " properties defined !");
application.output("Key Value");
application.output("");
var e = defaults.keys();
var output = [];
while (e.hasMoreElements()) {
var key = e.nextElement();
var str = key;
for (var j = 0; j < 70 - key.length; j++) str += " ";
str += "" + defaults.get(key);
output.push(str);
}
output.sort();
output.forEach(function(x) { application.output(x) });
}
Users browsing this forum: No registered users and 17 guests