Look And Feel

The Swing GUI can be shown with a configurable appearance using Java's pluggable look and feel feature. AntInstaller includes a look and feel by JGoodies which is now licenced under a BSD license.

Since JGoodies is under a good open source license it has been possible to make minor modifications to the code to enable antialiasing of text components. This is more resource intensive but looks a lot better. In order not to clash with the original JGoodies code the modifications have be repackaged as org.tp23.jgoodies.* so both UIs can be on the classpath at the sametime. In AntInstaller the antialiasing can be activated with the antialiased attribute in the installer element.

When designing a cross platform installer remember that Micro$oft look and feels will not run on other platforms and will throw exceptions. Some of the JGoodies look and feels have the same issue, so check first.

There is small look and feel included with AntInstaller that is a simple modification of the MetalLookAndFeel that uses a monochrome theme and less use of bold fonts, the font size is also reduced one point. This look and feel has been included to enable installers to be delivered with a consistent look on multiple platforms and have space on the buttons and labels to show the default English text in the installer. The download size is also reduced. For more space for text the width of the installer can be increased with the wide attribute of the installer element in the configuration file.
The purple theme has been removed because it looks naf! (sorry Sun but its true).

Setting the look and feel

To set the look and feel for the swing GUI the lookAndFeel attribute of the installer element in antinstall-config.xml should be set. The value of the lookAndFeel attribute should be a fully qualified class name or one of the following values that have special treatment.
  • null - No alterations are made to the look and feel.
  • greymetal - The monochrome metal look and feel is used. Equivalent to org.tp23.antinstaller.renderer.swing.plaf.ModMetalLookAndFeel.
  • native - The native look and feel of the computer on which the installer is run is used. The value is that returned by UIManager.getSystemLookAndFeelClassName().
  • jgoodies - The JGoodies look and feel org.tp23.jgoodies.plaf.plastic.PlasticXPLookAndFeel is used.
If the lookAndFeel attribute is missing org.tp23.jgoodies.plaf.plastic.PlasticXPLookAndFeel is the default.

If the default look and feel or greymetal is specified in the configuration the Ant task will include the correct classes automatically in the self-extracting or non-extracting Jar. If a custom look and feel is to be used the classes must be added specifically to the classpath or inside the Jar.

If the self-extracting jar is used, in order to show the progress panel with the correct look and feel, the value in the configuration file can not be used since it is not yet loaded. An additional element Look-And-Feel to the META-INF/ file should be added.
Provided the installer is build with the Ant task this is handled automaticaly.


JGoodies - org.tp23.jgoodies.plaf.plastic.PlasticXPLookAndFeel
JGoodies screenshot

Metouia - net.sourceforge.mlf.metouia.MetouiaLookAndFeel
Metouia screenshot

Grey Metal - org.tp23.antinstaller.renderer.swing.plaf.ModLookAndFeel
Greymetal screenshot

show menu