Wednesday 10 April 2013

Create Desktop application in Java Using XML

http://stackoverflow.com/questions/5213838/java-create-a-gui-with-xml

1.There are some Java-based engines to render XUL (using Swing), but I'm not sure what state they are in.



I have had good experience with ANTFormhttp://antforms.sourceforge.net/.
It generates Java Swing panels from XML. I have used it to build simple GUI apps that execute ANT targets.
Example of the XML declaration:
<antform title="Send Mail" 
    save="properties.txt"
    image="doc/images/testlogo.jpg">
    <label>To send a mail, use the following form. Pick a recipient,
 type a subject and a body...the script will do the rest.</label>
    <selectionProperty label="Recipient: " 
    property="recipient" 
    values="address1@somewhere.com; address2@somewhere.com; address4@somewhere.com" 
    separator=";"/>
    <textProperty label="Subject : " property="subject" />
    <multilineTextProperty label="Message body: "
        property="body"/>
    <booleanProperty label="Send immediately: " property="send"/>
</antform>
Example of what it produces:
enter image description here
share|edit
I used Apache Pivot http://pivot.apache.org/ and really liked it.

No comments:

Post a Comment