Custom Icons

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.

Attribute

Description

Required

Attribute

Description

Required

res

Path 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

id

The 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.

Attribute

Description

Required

Attribute

Description

Required

res

Path 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

id

The 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="/resources/JFrameIcon" 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.

Image

ID

Usage

Size

Image

ID

Usage

Size

JFrameIcon

Window icon for installer and language selection dialog.

16x16

bookmark

Application URL on Hello Panel.

16x16

check

Successful installation on Finish Panels.

32x32

done

Exit button for successful installation.

16x16

edit

Automated script button on Finish Panel; description of Info Panels.

16x16

empty

Blank spacer on Finish Panels and Hello Panel.

16x16

help

Panel Help button.

16x16

history

Description of Licence Panels and Installation Type Panel.

16x16

home

 

16x16

host

Welcome message on Hello Panel.

16x16

import

 

16x16

information

Product information on Hello Panel.

16x16

link16x16

Shortcut Panel header.

16x16

open

Browse button for Path Panels and multi-volume installers.

16x16

preferences

Description of Packs Panels; progress description on Install Panel; success description on Finish Panels.

16x16

refresh_cycle

 

16x16

stepback

Previous button.

16x16

stepforward

Next button.

16x16

stop

Quit button (installer and uninstaller); exit button for failed installation.

16x16

tip

Info 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.

Image

ID

Usage

Size

Image

ID

Usage

Size

FileChooser.homeFolderIcon

Home directory button in File Chooser.

16x16

FileChooser.newFolderIcon

New directory button in File Chooser.

16x16

FileChooser.upFolderIcon

Up directory (i.e. ..) button in File Chooser.

16x16

FileView.computerIcon

Icon for directories representing the computer.

16x16

FileView.directoryIcon

Icon for regular directories.

16x16

FileView.fileIcon

Icon for files.

16x16

FileView.floppyDriveIcon

Icon for floppy drives.

16x16

FileView.hardDriveIcon

Icon for hard drives.

16x16

OptionPane.errorIcon

Error message dialog.

32x32

OptionPane.informationIcon

Information message dialog.

32x32

OptionPane.questionIcon

Question message dialog.

32x32

OptionPane.warningIcon

Warning message dialog.

32x32