Java Swing UIManager LookAndFeel (LAF) Defaults


Background

Java has a very flexible UI called Swing for making nice user interfaces. It has come on a long way in the last couple of years, especially since Java 6 was released.

Swing has a very good system for plugging in custom Look and Feels (LAFs). You can download some excellent third-party LAFs for Swing (Substance is a good example), or you can make minor tweaks to the LAF that you are using, e.g. "make all button foreground text red".

The Problem

The way you achieve the example above is something along the lines of:

	UIManager.put("JButton.foreground", Color.RED);

.. all fine so far. But how do you know what keys (e.g. the JButton.foreground bit) are available for a given LAF?

Sun's position on this appears to be that the keys are intentionally not exposed as they may (and do) change between LAFs and from Java version to Java version. That's perfectly valid if you're writing cross-platform, portable code, but sometimes you know that you're using a particular LAF on a given platform.

Anyway..

I've put together a simple Java program (UIDefaults) which, when run, creates a HTML page for each LAF available on your machine, listing all the UIManager keys available and their values. There are many combinations of LAFs, platforms and Java versions - this is where I need your help. Take a look at the Library (further down). If you have a platform or version of Java that isn't on this list, please run UIDefaults on your system and email me the results so that I can add them to the library.

Download

UIDefaults.zip (62K)
Extract the ZIP to a directory of your choosing, and either double-click UIDefaults.jar, or use the command-line, change into the UIDefaults directory and
	java -jar UIDefaults.jar
You should see some text output and a few windows may flash up for a second or so, then disappear. This is normal. A directory should be created 'output/pages' which will contain HTML files that you can peruse in a web browser (and hopefully email to me so I can expand the library).

Email me

	


The Library

This is a list of all the UIManager default keys and values that I've found / been sent so far, for different versions of Java, Operating Systems and LAFs:

FilenameCreated
UIDefaults_Java1.5.0_06_Windows_2000_5.0_Metal.htmlAug 08 2013 04:44:35
UIDefaults_Java1.5.0_06_Windows_2000_5.0_CDE_Motif.htmlAug 08 2013 04:44:36
UIDefaults_Java1.5.0_06_Windows_2000_5.0_Windows.htmlAug 08 2013 04:44:36
UIDefaults_Java1.5.0_16_Mac_OS_X_10.4.11_CDE_Motif.htmlAug 08 2013 04:44:36
UIDefaults_Java1.5.0_16_Mac_OS_X_10.4.11_Mac_OS_X.htmlAug 08 2013 04:44:36
UIDefaults_Java1.5.0_16_Mac_OS_X_10.4.11_Metal.htmlAug 08 2013 04:44:36
UIDefaults_Java1.6.0_11_Windows_2000_5.0_Metal.htmlAug 08 2013 04:44:36
UIDefaults_Java1.6.0_11_Windows_2000_5.0_Nimbus.htmlAug 08 2013 04:44:36
UIDefaults_Java1.6.0_11_Windows_2000_5.0_Windows.htmlAug 08 2013 04:44:36
UIDefaults_Java1.6.0_11_Windows_2000_5.0_CDE_Motif.htmlAug 08 2013 04:44:36
UIDefaults_Java1.5.0_10_Linux_2.6.21.4-eeepc_CDE_Motif.htmlAug 08 2013 04:44:36
UIDefaults_Java1.5.0_10_Linux_2.6.21.4-eeepc_GTK+.htmlAug 08 2013 04:44:36
UIDefaults_Java1.5.0_10_Linux_2.6.21.4-eeepc_Metal.htmlAug 08 2013 04:44:36
UIDefaults_Java1.6.0_13_Windows_Vista_6.0_Windows_Classic.htmlAug 08 2013 04:44:36
UIDefaults_Java1.6.0_13_Windows_Vista_6.0_Windows.htmlAug 08 2013 04:44:36
UIDefaults_Java1.6.0_13_Windows_Vista_6.0_Nimbus.htmlAug 08 2013 04:44:36
UIDefaults_Java1.6.0_13_Windows_Vista_6.0_Metal.htmlAug 08 2013 04:44:36
UIDefaults_Java1.6.0_13_Windows_Vista_6.0_CDE_Motif.htmlAug 08 2013 04:44:36
UIDefaults_Java1.6.0_14_Windows_XP_5.1_CDE_Motif.htmlAug 08 2013 04:44:36
UIDefaults_Java1.6.0_14_Windows_XP_5.1_Metal.htmlAug 08 2013 04:44:36
UIDefaults_Java1.6.0_14_Windows_XP_5.1_Nimbus.htmlAug 08 2013 04:44:36
UIDefaults_Java1.6.0_14_Windows_XP_5.1_Windows.htmlAug 08 2013 04:44:36
UIDefaults_Java1.6.0_14_Windows_XP_5.1_Windows_Classic.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_17_Mac_OS_X_10.6.2_Nimbus.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_17_Mac_OS_X_10.6.2_Metal.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_17_Mac_OS_X_10.6.2_Mac_OS_X.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_17_Mac_OS_X_10.6.2_CDE_Motif.htmlAug 08 2013 04:44:37
UIDefaults_Java1.7.0_Linux_2.6.38-11-server_CDE_Motif.htmlAug 08 2013 04:44:37
UIDefaults_Java1.7.0_Linux_2.6.38-11-server_Metal.htmlAug 08 2013 04:44:37
UIDefaults_Java1.7.0_Linux_2.6.38-11-server_Nimbus.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_26_Mac_OS_X_10.6.8_CDE_Motif.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_26_Mac_OS_X_10.6.8_Mac_OS_X.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_26_Mac_OS_X_10.6.8_Metal.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_26_Mac_OS_X_10.6.8_Nimbus.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_26_Windows_7_6.1_CDE_Motif.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_26_Windows_7_6.1_Metal.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_26_Windows_7_6.1_Windows.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_26_Windows_7_6.1_Windows_Classic.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_26_Windows_7_6.1_Nimbus.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_27_Linux_2.6.34.9-69.fc13.i686.PAE_CDE_Motif.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_27_Linux_2.6.34.9-69.fc13.i686.PAE_GTK+.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_27_Linux_2.6.34.9-69.fc13.i686.PAE_Metal.htmlAug 08 2013 04:44:37
UIDefaults_Java1.6.0_27_Linux_2.6.34.9-69.fc13.i686.PAE_Nimbus.htmlAug 08 2013 04:44:37
UIDefaults_Java1.7.0_45_Windows_7_6.1_CDE_Motif.htmlJan 02 2014 15:05:46
UIDefaults_Java1.7.0_45_Windows_7_6.1_Metal.htmlJan 02 2014 15:05:48
UIDefaults_Java1.7.0_45_Windows_7_6.1_Nimbus.htmlJan 02 2014 15:05:50
UIDefaults_Java1.7.0_45_Windows_7_6.1_Windows.htmlJan 02 2014 15:05:52
UIDefaults_Java1.7.0_45_Windows_7_6.1_Windows_Classic.htmlJan 02 2014 15:05:52



Useful?

If you find this useful, please consider visiting my other website and clicking on a few adverts, as they support these websites.

Missing?

If the LAF, platform or version of Java which you're interested in is not on this list, please consider downloading UIDefaults (above) and emailing me the results.


(c) Duncan Jauncey, 2009