HOWTO: Associate an icon with a JET-compiled executable
Article ID: 000003 PDF Version: 000003.pdf The information in this article applies to:
Source files and build/run scripts for this article may be found here. If you are using Excelsior JET version prior to 4.5, refer to the samples/BeforeJET4.5 folder, else use samples/FromJET4.5 folder. A shortcut icon is a standard Windows icon file bound to the executable. It is used, in particular, when you place a shortcut to that executable on your desktop or add it to the Start Menu. That icon is also displayed in the application’s console title bar, provided your app has a console. It is very easy to associate a Windows icon file with the resulting EXE file using the JET Control Panel. On the Appearance page, type the full path of the desired .ico file in the Icon field, or click Browse to select the icon file using a conventional file dialog. /For JET 4.0 and below the respective controls are placed on Resources page./ If you do not use the JET Control Panel, add the .ico file to the project using the !module directive: !module myico.ico
To display your own icon in the title bar of a Swing/AWT window instead of the standard Java icon, use the method javax.swing.JFrame.setIconImage(). For example, if the icon image is stored as "./images/myico.gif" in one of the application’s jar files, use code similar to the following:
The icon image file must be accessible via CLASSPATH at run time, or placed in a jar bound to the executable (see below).
To display a custom icon in the title bar of an SWT window, call the method org.eclipse.swt.widgets.Shell.setImage(). For example, if the icon image is stored as "./images/myico.gif" in one of the application’s jar files, use code such as the following:
The icon image file must be accessible via CLASSPATH at run time, or placed in a jar packed into the executable (see below). If the icon image resides in a jar file, you can pack resources from that jar into the compiled executable. This way, the resulting executable will include the associated icon and you do not have to worry about classpath. Resource packing is controlled through the Classpath page of the JET Control Panel and PACK equation of jc command line compiler. /For JET 4.1 and below resource packing was controlled through the Resource page./
Copyright © 2003-2006 Excelsior LLC. All rights reserved.
|
|
Home | Company | Products | Services | Resources | Blog | Contact | Request a Call Site: Search | Forum | Credits © 1999-2006 Excelsior LLC. All Rights Reserved. |