There seem to be a ton of UI properties that can be set with
UIManager.put("key", value);
Is there a list somewhere of all keys that can be set?
There seem to be a ton of UI properties that can be set with
UIManager.put("key", value);
Is there a list somewhere of all keys that can be set?
For what it's worth, you can find a fancier version of this where all the properties are displayed in a GUI with each component on a separate tab in a tabbed pane. You can also change the LAF. Check out UIManager Defaults.
It depends on the Java implementation. Here is the simple code that you can run to see all available properties and their current values.
public static void main(String[] args) {
UIDefaults defaults = UIManager.getDefaults();
System.out.println(defaults.size()+ " properties defined !");
String[ ] colName = {"Key", "Value"};
String[ ][ ] rowData = new String[ defaults.size() ][ 2 ];
int i = 0;
for(Enumeration e = defaults.keys(); e.hasMoreElements(); i++){
Object key = e.nextElement();
rowData[ i ] [ 0 ] = key.toString();
rowData[ i ] [ 1 ] = ""+defaults.get(key);
System.out.println(rowData[i][0]+" ,, "+rowData[i][1]);
}
JFrame f = new JFrame("UIManager properties default values");
JTable t = new JTable(rowData, colName);
f.setContentPane(new JScrollPane(t));
//f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.pack();
f.setVisible(true);
}
The code posted before just gets the properties set by the current look&feel which is the metal l&f by default.
It lists a total of 636 defined properties on my system (WinXP with Java 1.6.0_17) with less defined on Windows L&F and Motif L&F. I found another list on the internet (http://www.java2s.com/Tutorial/Java/0240__Swing/ListingUIDefaultProperties.htm) where 795 are found.
So I think the question still remains: Which properties are there? Obviously, even the Metal L&F doesn't set them all (or the code resulting in 795 is wrong).
I am puzzled by the fact there doesn't seem to exist an official list by sun, which would be what I really am looking for (as well as the OP if I got the question right).