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.7.0_45_Windows_7_6.1_Nimbus.htmlMay 19 2015 22:58:42
UIDefaults_Java1.6.0_26_Windows_7_6.1_Windows_Classic.htmlMay 19 2015 22:58:34
UIDefaults_Java1.6.0_26_Windows_7_6.1_Metal.htmlMay 19 2015 22:58:28
UIDefaults_Java1.5.0_10_Linux_2.6.21.4-eeepc_GTK+.htmlMay 19 2015 22:57:43
UIDefaults_Java1.6.0_26_Windows_7_6.1_CDE_Motif.htmlMay 19 2015 22:58:27
UIDefaults_Java1.7.0_45_Windows_7_6.1_Windows_Classic.htmlMay 19 2015 22:58:47
UIDefaults_Java1.6.0_13_Windows_Vista_6.0_Nimbus.htmlMay 19 2015 22:58:04
UIDefaults_Java1.5.0_16_Mac_OS_X_10.4.11_CDE_Motif.htmlMay 19 2015 22:57:45
UIDefaults_Java1.6.0_14_Windows_XP_5.1_Nimbus.htmlMay 19 2015 22:58:11
UIDefaults_Java1.6.0_26_Mac_OS_X_10.6.8_Metal.htmlMay 19 2015 22:58:24
UIDefaults_Java1.6.0_14_Windows_XP_5.1_Windows_Classic.htmlMay 19 2015 22:58:13
UIDefaults_Java1.7.0_Linux_2.6.38-11-server_Nimbus.htmlMay 19 2015 22:31:38
UIDefaults_Java1.6.0_14_Windows_XP_5.1_CDE_Motif.htmlMay 19 2015 22:58:06
UIDefaults_Java1.6.0_17_Mac_OS_X_10.6.2_Nimbus.htmlMay 19 2015 22:58:19
UIDefaults_Java1.6.0_13_Windows_Vista_6.0_Metal.htmlMay 19 2015 22:58:02
UIDefaults_Java1.5.0_16_Mac_OS_X_10.4.11_Mac_OS_X.htmlMay 19 2015 22:57:47
UIDefaults_Java1.7.0_Linux_2.6.38-11-server_Metal.htmlMay 19 2015 22:58:48
UIDefaults_Java1.6.0_14_Windows_XP_5.1_Windows.htmlMay 19 2015 22:58:11
UIDefaults_Java1.6.0_11_Windows_2000_5.0_Windows.htmlMay 19 2015 22:57:59
UIDefaults_Java1.6.0_14_Windows_XP_5.1_Metal.htmlMay 19 2015 22:58:08
UIDefaults_Java1.6.0_26_Windows_7_6.1_Nimbus.htmlMay 19 2015 22:58:32
UIDefaults_Java1.5.0_10_Linux_2.6.21.4-eeepc_CDE_Motif.htmlMay 19 2015 22:57:39
UIDefaults_Java1.7.0_45_Windows_7_6.1_Windows.htmlMay 19 2015 22:58:45
UIDefaults_Java1.6.0_27_Linux_2.6.34.9-69.fc13.i686.PAE_GTK+.htmlMay 19 2015 22:58:35
UIDefaults_Java1.6.0_13_Windows_Vista_6.0_CDE_Motif.htmlMay 19 2015 22:57:58
UIDefaults_Java1.6.0_26_Mac_OS_X_10.6.8_Mac_OS_X.htmlMay 19 2015 22:58:21
UIDefaults_Java1.5.0_06_Windows_2000_5.0_CDE_Motif.htmlMay 19 2015 22:57:35
UIDefaults_Java1.6.0_27_Linux_2.6.34.9-69.fc13.i686.PAE_Metal.htmlMay 19 2015 22:58:36
UIDefaults_Java1.6.0_17_Mac_OS_X_10.6.2_CDE_Motif.htmlMay 19 2015 22:58:14
UIDefaults_Java1.5.0_06_Windows_2000_5.0_Windows.htmlMay 19 2015 22:57:38
UIDefaults_Java1.6.0_11_Windows_2000_5.0_CDE_Motif.htmlMay 19 2015 22:57:53
UIDefaults_Java1.6.0_13_Windows_Vista_6.0_Windows.htmlMay 19 2015 22:58:04
UIDefaults_Java1.6.0_26_Mac_OS_X_10.6.8_CDE_Motif.htmlMay 19 2015 22:58:20
UIDefaults_Java1.6.0_11_Windows_2000_5.0_Nimbus.htmlMay 19 2015 22:57:58
UIDefaults_Java1.6.0_26_Mac_OS_X_10.6.8_Nimbus.htmlMay 19 2015 22:58:27
UIDefaults_Java1.6.0_27_Linux_2.6.34.9-69.fc13.i686.PAE_CDE_Motif.htmlMay 19 2015 22:58:35
UIDefaults_Java1.7.0_45_Windows_7_6.1_CDE_Motif.htmlMay 19 2015 22:58:42
UIDefaults_Java1.7.0_45_Windows_7_6.1_Metal.htmlMay 19 2015 22:58:42
UIDefaults_Java1.5.0_06_Windows_2000_5.0_Metal.htmlMay 19 2015 22:57:35
UIDefaults_Java1.5.0_16_Mac_OS_X_10.4.11_Metal.htmlMay 19 2015 22:57:51
UIDefaults_Java1.6.0_13_Windows_Vista_6.0_Windows_Classic.htmlMay 19 2015 22:58:05
UIDefaults_Java1.5.0_10_Linux_2.6.21.4-eeepc_Metal.htmlMay 19 2015 22:57:42
UIDefaults_Java1.6.0_17_Mac_OS_X_10.6.2_Metal.htmlMay 19 2015 22:58:19
UIDefaults_Java1.6.0_27_Linux_2.6.34.9-69.fc13.i686.PAE_Nimbus.htmlMay 19 2015 22:58:47
UIDefaults_Java1.6.0_17_Mac_OS_X_10.6.2_Mac_OS_X.htmlMay 19 2015 22:58:17
UIDefaults_Java1.7.0_Linux_2.6.38-11-server_CDE_Motif.htmlMay 19 2015 22:58:47
UIDefaults_Java1.6.0_11_Windows_2000_5.0_Metal.htmlMay 19 2015 22:57:54
UIDefaults_Java1.6.0_26_Windows_7_6.1_Windows.htmlMay 19 2015 22:58:30



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