> List of tutorials


Fat-Client-Development - Setting the properties of the GUI-Elements, Part 2

* For this document and all references (links) please obey the hints and regulations concerning copyright, disclaimer and trademarks.

  • The owner of this web-site (www.javascout.biz) is not responsible for the content of web-sites linked within this document or other documents of www.javascout.biz.

  • If this document or other documents of this web-site (www.javascout.biz) infringes rights of third parties and your rights are infringed or you think that rights of others are infringed, please inform the author.
    An e-mail can be sent by clicking onto the 'hungry mailbox' in the upper right corner.

Last revision of this document:
2006-05-05

In the previous step code was presented to set the properties (in detail: the text in the title-bar) of a JFrame.
The properties were read from a language-dependant file containing a XML-structure defining the fitting properties for each GUI-element.

In this step, the code is extended to set the properties also for JLabel, JTextField and JButton.
Also, the algorithm to get properties which are defined as 'Common' (i.e. belonging to more than one GUI-element), is documented.
For a detailed explanation of the XML-structure with the properties please see Structure of the xml-file with language dependant strings for the user-interface.

Preface:

This document does not contain the complete code.
This decision was made to avoid an overloading. The idea was to give an explanation how the XML-structure is searched and the properties are set at the GUI-elements.

For a complete listing of the code please follow the links at the code-snippets.

The code written in this tutorial is highly optimized !
It is not essential that you completely understand the code for getting an idea how Fat-Clients are developed
.

Credits:

Several and none; using recursive structures is a common process - I just applied it for that special case.

Prerequisites:

Edit the content of file 'DisplayStrings.xml' to add the properties for the JLabel:

The properties for the GUI-element 'lbl_Welcome' (of type Jlabel) and 'btn_Maintain' (of type Jbutton) are added.
Both elements were coded in step JS_FC01d - Create and code the class for the GUI.

top.

Define the constants representing errors :

top.

Code for searching the XML-structure and transferring the properties to the GUI-element :

top.

Run the application to see a result of the implemented code

top.

Next Step: