Custom Icons

Custom Icons 

The icon images used on the buttons, and in the title bar, of the IzPack installer can all be replaced with your own custom icons, by including the resource customicons.xml. In addition, icon files must also be defined as resources, or included in a merged JAR. Acceptable image file formats include GIF, JPEG, and PNG. IzPack uses the PNG format. Image size should match the size of the icon being replaced (see the lists at the bottom of the page).

This mechanism can also be used to replace any standard icons used by the Java Swing components. IzPack already defines some alternative icons for the Swing components, such as the file selection dialog. All standard IzPack icons are listed at the end of this page.

customicons.xml 

The resource file customicons.xml has a single root element <icons>, which has no attributes. It should be added to the <resources> section with the ID "customicons.xml".

<res id="customicons.xml" src="my-installer-files/customicons.xml" />

Nested Elements

icon

This defines alternative icons for IzPack GUI components, such as installer buttons and decorations.

AttributeDescriptionRequired
resPath within the installer JAR where the icon file is stored. May be absolute (e.g. /resources/icon.png) or relative to the IzPack class file com.izforge.izpack.installer.gui.InstallerFrame. Yes
idThe ID of the standard IzPack icon to replace. See the list of standard icons, below.Yes

sysicon

This defines alternative icons for Java Swing components, such as the buttons and decorations on built-in dialog boxes.

AttributeDescriptionRequired
resPath within the installer JAR where the icon file is stored. May be absolute (e.g. /resources/icon.png) or relative to the IzPack class file com.izforge.izpack.installer.gui.InstallerFrame.Yes
idThe name of the icon-type Swing component property to replace. See the component properties documentation in the Java API for a full list of customisable properties (any property with type Icon can be specified). The icons replaced as standard by IzPack's default behaviour are listed below in the list of alternative Swing icons.Yes

 

Here is an example of a customicons.xml file :

<izpack:icons version="5.0"
              xmlns:izpack="http://izpack.org/schema/icons"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://izpack.org/schema/icons http://izpack.org/schema/5.0/izpack-icons-5.0.xsd">
    <icon res="/resources/JFrameIcon" id="JFrameIcon"/>
    <icon res="/resources/next" id="stepforward"/>
    <icon res="/resources/previous" id="stepback"/>
</izpack:icons>

Resources 

One way to provide the icon files themselves, is to include them as resources in the <resources> section of the install spec. In this case, the res attribute for the icon spec in customicons.xml must be specified as "/resources/resource-id". 

Example resource entry in install.xml
<res id="JFrameIcon" src="my-installer-files/JFrameIcon.png"/>
Corresponding entry in customicons.xml
<icon res="/resources/JFrameIcon.png" id="JFrameIcon"/>

Merged JARs

If you develop your own extensions to IzPack, and include them in the installer using the <jar> element, you can put your own icons inside your extension JAR as an alternative to using resources. In this case, you would specify the absolute path to the icon in your JAR in the res attribute for the entry in customicons.xml.

<icon res="/com/myizpackjar/img/JFrameIcon.png" id="JFrameIcon"/> 

List of standard icons

This section lists and displays all standard IzPack icons that are used by default, along with the icon ID (which is needed for defining custom icons), and a brief description of where it's used. Replace these using an <icon> tag in customicons.xml.

ImageIDUsageSize
JFrameIconWindow icon for installer and language selection dialog.16x16
bookmarkApplication URL on Hello Panel.16x16
checkSuccessful installation on Finish Panels.32x32
doneExit button for successful installation.16x16
editAutomated script button on Finish Panel; description of Info Panels.16x16
emptyBlank spacer on Finish Panels and Hello Panel.16x16
helpPanel Help button.16x16
historyDescription of Licence Panels and Installation Type Panel.16x16
home 16x16
hostWelcome message on Hello Panel.16x16
import 16x16
informationProduct information on Hello Panel.16x16
link16x16Shortcut Panel header.16x16
openBrowse button for Path Panels and multi-volume installers.16x16
preferencesDescription of Packs Panels; progress description on Install Panel; success description on Finish Panels.16x16
refresh_cycle 16x16
stepbackPrevious button.16x16
stepforwardNext button.16x16
stopQuit button (installer and uninstaller); exit button for failed installation.16x16
tipInfo text on Packs Panels and Sudo Panel; progress description on Compile Panel.16x16

List of alternative Swing icons

This table lists all built-in Java Swing component icons replaced by default in a standard IzPack installer. Replace these (or any other Icon-type Swing component property) using a <sysicon> tag in customicons.xml.

ImageIDUsageSize
FileChooser.homeFolderIconHome directory button in File Chooser.16x16
FileChooser.newFolderIconNew directory button in File Chooser.16x16
FileChooser.upFolderIconUp directory (i.e. ..) button in File Chooser.16x16
FileView.computerIconIcon for directories representing the computer.16x16
FileView.directoryIconIcon for regular directories.16x16
FileView.fileIconIcon for files.16x16
FileView.floppyDriveIconIcon for floppy drives.16x16
FileView.hardDriveIconIcon for hard drives.16x16
OptionPane.errorIconError message dialog.32x32
OptionPane.informationIconInformation message dialog.32x32
OptionPane.questionIconQuestion message dialog.32x32
OptionPane.warningIconWarning message dialog.32x32