Skin Look And Feel comes bundled with a default theme pack lib/themepack.zip
. Its definition file looks like:
<?xml version="1.0"?>
<skinlf-themepack require="0.3">
<property name="JDesktopPane.backgroundEnabled" value="false" />
<property name="ScrollBar.alternateLayout" value="true" />
<icon name="Tree.openIcon" value="icons/TreeOpen.gif" />
<icon name="Tree.closedIcon" value="icons/TreeClosed.gif" />
<icon name="FileView.computerIcon" value="icons/Computer.gif" />
<icon name="FileView.directoryIcon" value="icons/TreeClosed.gif" />
<icon name="FileView.fileIcon" value="icons/Default.gif" />
<icon name="FileView.hardDriveIcon" value="icons/HardDrive.gif" />
<icon name="FileView.floppyDriveIcon" value="icons/FloppyDrive.gif" />
<icon name="InternalFrame.icon" value="icons/InternalFrame.gif" />
<skin>
<skin url="gtk/gtkrc"></skin>
<skin url="kde/kde.themerc"></skin>
</skin>
</skinlf-themepack>
|
XML is used for the definition file. The definition file can be validated against the DTD:
<!ELEMENT skinlf-themepack (property*, icon*, skin)>
<!ATTLIST skinlf-themepack
require CDATA #REQUIRED>
<!ELEMENT property>
<!ATTLIST property
name CDATA #REQUIRED
value CDATA #REQUIRED>
<!ELEMENT icon>
<!ATTLIST icon
name CDATA #REQUIRED
value CDATA #REQUIRED>
<!ELEMENT skin (skin*)>
<!ATTLIST skin
url CDATA #IMPLIED>
|
In the previous example, property and icon XML tags are used to set custom properties and icons at runtime. <property name="JDesktopPane.backgroundEnabled" value="false" />
is equivalent to javax.swing.UIManager.put("JDesktopPane.backgroundEnabled", Boolean.FALSE);
.
The icon tag can be used to provide custom icons for JTree nodes, plus and minus signs, JFileChooser directories, JInternalFrame default icon, etc.