You can create your user interface using the GUI Builder tool.
To start the GUI Builder, use the following command:
java com.ibm.as400.ui.tools.GUIBuilder [-plaf look and feel]
If you did not set your CLASSPATH environment variable to contain the Graphical Toolbox JAR files, then you will need to specify them on the command line using the classpath option. See Setting Up the Graphical Toolbox.
When you start the GUI Builder for the first time, you need to create a new PDML file. From the menu bar on the GUI Builder widow, select File --> New File. After you create your new PDML file, you can define any of the following types of UI resources that you want it to contain.
The translatable strings for a panel are not stored in the PDML file itself, but in a separate Java™ resource bundle. The tools let you specify how the resource bundle is defined, either as a Java PROPERTIES file or as a ListResourceBundle subclass. A ListResourceBundle subclass is a compiled version of the translatable resources, which enhances the performance of your Java application. However, it will slow down the GUI Builder's saving process, because the ListResourceBundle will be compiled in each save operation. Therefore it's best to start with a PROPERTIES file (the default setting) until you're satisfied with the design of your user interface.
You can use the tools to generate HTML skeletons for each panel in the PDML file. At runtime, the correct help topic is displayed when the user clicks on the panel's Help button or presses F1 while the focus is on one of the panel's controls. You must insert your help content at the appropriate points in the HTML, within the scope of the <!-- HELPDOC:SEGMENTBEGIN --> and <!-- HELPDOC:SEGMENTEND --> tags. For more specific help information see Editing Help Documents generated by GUI builder.
You can generate source code skeletons for the JavaBeans™ that will supply the data for a panel. Use the Properties window of the GUI Builder to fill in the DATACLASS and ATTRIBUTE properties for the controls which will contain data. The DATACLASS property identifies the class name of the bean, and the ATTRIBUTE property specifies the name of the gettor/settor methods that the bean class implements. Once you've added this information to the PDML file, you can use the GUI Builder to generate Java source code skeletons and compile them. At runtime, the appropriate gettor/settor methods will be called to fill in the data for the panel.
Finally, you can serialize the contents of your PDML file. Serialization produces a compact binary representation of all of the UI resources in the file. This greatly improves the performance of your user interface, because the PDML file must not be interpreted in order to display your panels.
To summarize: If you have created a PDML file named MyPanels.pdml, the following files will also be produced based on the options you have selected on the tools:
To start the Resource Script Converter, invoke the Java interpreter as follows:
java com.ibm.as400.ui.tools.PDMLViewer
If you did not set your CLASSPATH environment variable to contain the Graphical Toolbox JAR files, then you will need to specify them on the command line using the classpath option. See Setting Up the Graphical Toolbox.
You can also run the Resource Script Converter in batch mode using the following command:
java com.ibm.as400.ui.tools.RC2XML file [options]
Where file is the name of the resource script (RC file) to be processed. Options
All dialogs, menus, and string tables found in the RC file will be converted to the corresponding Graphical Toolbox resources in the generated PDML file. You can also define DATACLASS and ATTRIBUTE properties for Windows controls that will be propagated to the new PDML file by following a simple naming convention when you create the identifiers for your Windows resources. These properties will be used to generate source code skeletons for your JavaBeans when you run the conversion.
The naming convention for Windows resource identifiers is:
IDCB_<class name>_<attribute>
where <class name> is the fully-qualified name of the bean class that you want to designate as the DATACLASS property of the control, and <attribute> is the name of the bean property that you want to designate as the ATTRIBUTE property of the control.
For example, a Windows text field with the resource ID IDCB_com_MyCompany_MyPackage_MyBean_SampleAttribute produces a DATACLASS property of com.MyCompany.MyPackage.MyBean and an ATTRIBUTE property of SampleAttribute. If you elect to generate JavaBeans when you run the conversion, the Java source file MyBean.java is produced, containing the package statement package com.MyCompany.MyPackage, and gettor and settor methods for the SampleAttribute property.