Java:用XML创建GUI?

时间:2011-03-06 22:17:41

标签: java xml user-interface swing frameworks

我正在寻找最流行的框架来创建一个带有xml定义的java gui。我更喜欢Swing!

您的意见是必要的,谢谢!

6 个答案:

答案 0 :(得分:6)

我对 ANTForm http://antforms.sourceforge.net/有很好的经验。

它从XML生成Java Swing面板。我用它来构建执行ANT目标的简单GUI应用程序。

XML声明示例:

<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>

它产生的例子:

enter image description here

答案 1 :(得分:4)

我建议检查FXML有一个由oracle制作的简洁工具,可用于制作GUI以下是一些很好的入门链接。

http://docs.oracle.com/javafx/2/fxml_get_started/jfxpub-fxml_get_started.htm

http://docs.oracle.com/javafx//scenebuilder/1/get_started/jsbpub-get_started.htm

您不需要使用SceneBuilder工具,但在使用FXML创建gui时,它会变得非常简单。

答案 2 :(得分:3)

我不知道是否有适用于Java的流行的框架,但您可能会看一下{@ 3}}这是Firefox UI及其插件所使用的内容。

有一些基于Java的引擎可以呈现XUL,但我不确定它们处于什么状态。

答案 3 :(得分:2)

我使用了Apache Pivot http://pivot.apache.org/并且非常喜欢它。

答案 4 :(得分:0)

查看SWTSWT/XMLSWIXML了解Swing。

答案 5 :(得分:0)

Jaxe是我用过的东西。 但不确定它现在是否得到维护。