【问题标题】:Java: Create a GUI with XML?Java:使用 XML 创建 GUI?
【发布时间】:2011-07-09 23:43:02
【问题描述】:

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

需要您的意见,谢谢!

【问题讨论】:

标签: java xml user-interface swing frameworks


【解决方案1】:

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

它产生的例子:

【讨论】:

    【解决方案2】:

    我建议查看 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 时它使事情变得非常简单。

    【讨论】:

      【解决方案3】:

      我不知道是否有任何适用于 Java 的流行框架,但您可能会查看 Firefox UI 及其插件使用的 XUL

      有一些基于 Java 的引擎可以渲染 XUL (using Swing),但我不确定它们处于什么状态。

      【讨论】:

        【解决方案4】:

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

        【讨论】:

          【解决方案5】:

          查看 SWTSWT/XMLSWIXML 的 Swing。

          【讨论】:

            【解决方案6】:

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

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 2015-05-08
              • 2019-04-21
              • 2010-09-27
              • 2016-12-07
              • 1970-01-01
              • 2011-05-07
              • 1970-01-01
              • 1970-01-01
              相关资源
              最近更新 更多