Example for Java Swing GUI by XML > Overview
Previous Page Contents Next Page
OOP XMLPanelEdit home page

Contact Us

Overview

Easy 3 Steps

To ship your Java Swing based application by XMLPanelEdit, the following 3 steps are required:

The output of these steps are: , correspondingly. Note that the last output is the single JAR file which contains all the related files. The end users can start your product just by double clicking it, in case of Windows OS.

Project directory

To merge all the required files into a single JAR file in the last step, the output from the former 2 steps should be placed under the same root directory. So, for each of your product, the unique root directory should be allocated. This directory is called project directory and is specified by the project_root property of EditRun.properties.

To make the things clean,

should be created under the project directory. But, on the contrary, the compiled package hierarchy must reside just under the project directory.

When you extract the distribution file of this example, you will find example directory. Under example directory, you will find gui and image subdirectories. And, within these subdirectories, the XML files and image files for Swing GUI are already placed. Yes, example is the project directory of this example. According to your environment, please edit your EditRun.properties so that project_root property points example directory. And when you compile Java source files, please specify -d option to place the compiled class hierarchy under example directory.

Step 1: Represent Swing GUI in XML

By the Java Swing GUI tool (XML editor), you can write the Swing GUI into the XML. You can create the tree structure of Swing GUI and edit the properties of each Swing Java component. On some of Swing Java components, such as JButton or JLabel, image icons can be specified. To start this Java Swing GUI builder, please edit EditRun.properties and specify your serial ID and project directory.

Read more... >>

Step 2: Define classes for Swing GUI

For each XML for Swing GUI, you need to create the corresponding Java class. XMLPanelEdit includes the 3 abstract classes for generating the Swing GUI from XML. They are:

You only need to define your sub-class of one of them. Your sub-class can access any Java components on the GUI, i.e. you can add ActionListener to JButton on it.

Read more... >>

Step 3: Prepare the distribution file

For each one of your sub-classes, property resource files need to be prepared. Each property resource file must point the path to the XML for the Swing GUI. Because the run-time engine will read the property resource file appropriate for the run-time Locale, the different XML can be parsed for each run-time Locale. Based on the parsed XML, your sub-class can generate the actual Swing GUI.

So, please prepare property resource files for all your intended Locales along with the default one. Note that these property resource files need to be placed just under project directory.

Then, please create manifest file for the JAR file so that it specifies the main class of your application. With the main class specified, double-clicking the JAR file will start your application in case of Windows OS. On UNIX platform, supplying -jar option can start your application.

Now that all you need are prepared. Merge them all into a single JAR file is enough.

Read more... >>

Java and all Java-based trademarks and logos are trademarks or registered of Sun Microsystems, Inc. in the United States and other countries.


Previous Page Contents Next Page
OOP XMLPanelEdit home page

Contact Us


ALL CONTENTS COPYRIGHT 2002, Jun Inamori. All rights reserved.
Any questions and comments are welcome to Jun Inamori .