Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java: Create a GUI with XML?

im searching for the most popular framework to create a java gui with xml definitions. I prefer Swing!

Your opinions are needed, thanks!

like image 556
sebge23 Avatar asked Mar 06 '11 22:03

sebge23


People also ask

Can XML be used for UI?

XML tags define the data and used to store and organize data. It's easily scalable and simple to develop. In Android, the XML is used to implement UI-related data, and it's a lightweight markup language that doesn't make layout heavy. XML only contains tags, while implementing they need to be just invoked.

Can you make a GUI in Java?

The Java language provides a set of user interface components from which GUI forms can be built. The IDE's GUI Builder assists you in designing and building Java forms by providing a series of tools that simplify the process.

What is GUI XML?

XMLGUI is a KDE framework for designing the user interface of an application using XML, using the idea of actions.


1 Answers

I have had good experience with ANTForm: http://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="[email protected]; [email protected]; [email protected]" 
    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

like image 66
Mads Hansen Avatar answered Oct 08 '22 22:10

Mads Hansen