GUI (Graphical User Interface) builder are tools which allow application developers to visual compose graphical user interfaces. Ordinary this tools generate Java source code for the GUI components what prescribes some parts of the GUIs architecture.
One solution to achieve more flexibility here is to serialize the GUI components after construction and to deserialize it afterwards for usage in the application. In the periodic Java Spektrum 2/99 [JSPK] Niels Fricke, Carola Lilienthal, Martin Lippert, Stefan Roock and Henning Wolf presented this solution in the article "Unabhängigkeit von GUI-Buildern". This work is part of the JWAM Framework [JWAM].
To collect some experiences with this process I extracted and modified parts of the JWAM framework source code and built an sample application. You can download all source code and documentation as a zipped file.
To do it your own you need a Java IDE (Integrated Development Environment) with a GUI Builder for JDK 1.2.
To save a GUI component in a file carry out the following steps:
GUISerializerButton
to
your GUI Builder.Customize
property of the GUI
Serializer Button. Depending from the used IDE your this
allows you to save serialize the enclosing component into
a file. In the case this works you may skip the next
step.To display the stored GUI component from your application carry out the following steps:
GuiSerializer.read()
to deserialize the GUI component.GUIRegistry
and call method find()
to retrieve a
component by it's name.That's all!
setName()
for each accessible component (see example).The JWAM framework is open source under the GNU General Public License [GPL]. The same applies to my supplementaries.
[JAVA] Java technologie from Sun Microsystems.
[GPL] GNU General Public License.
Last update: 1999/07/10; Author: Bernhard Fischer.