|
XML Examples
Use SEditor to load the XML sample layouts Demo1.xml, Demo2.xml and Demo3.xml and study the node structure and the preview.
Java Examples
These are small application examples consisting of XML files and Java files.
To compile and run the examples, include smaker.jar and seditor_gr.zip in the classpath.
If jdk1.3 is used, the JAXP parser library must be installed (see Installation). For jdk 1.4 no additional parser package is required.
Note that the XML files are loaded from a directory that is in the classpath. For this reason, the directory where the sample XML files (JExampleXXX.xml) are located must be added to the classpath.
JExample1.java
is a simple example to demonstrate how SMaker cooperates with Swing: The main JFrame of the application contains a JList, a JTextField and a JButton. If a text is typed into the JTextField and the JButton is pushed, this text is added to the JList.
Remark: The file JExample1and3.xml must be found in the classpath.
JExample2.java
demonstrates how to work with XML files that contain multiple layouts and how internal frames and menus supported. The menu item "newNotesFrame" ("Show New Notes Frame") opens internal frames. The frames contain the same GUI elements as in JExample1 (to add notes to a notes list).
JExample3.java
shows the replacement of components that have been defined in the editor, by subclasses of that components at runtime. For example, when composing a form with SEditor, a JList has been added to the form (as a placeholder). In the application it will be replaced by a more specific component like MyJList. This feature is useful when the component cannot exist outside the application for some reason, for example because it needs data that are only available in the application and not in the SEditor.
|