2011-03-06 83 views
15

即时搜索最流行的框架来创建一个java定义的GUI。我更喜欢Swing!Java:用XML创建一个GUI?

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

+0

我一直在使用Swing大约5年,也宁愿使用它比其他任何东西。 – Jim 2011-03-06 22:22:39

+2

请参阅[使用Java进行声明性GUI编程的建议](http://stackoverflow.com/questions/761237/suggestions-for-declarative-gui-programming-in-java) – Jonas 2011-03-06 22:45:07

回答

3

我不知道是否有任何流行的框架在那里用于Java,但你可以看看XUL这是Firefox UI及其插件的用途。

有一些基于Java的引擎来渲染XUL (using Swing),但我不知道他们是在什么状态。

6

我已经有很好的经验ANTFormhttp://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="[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> 

例子:

enter image description here

0

Jaxe是我用过的一样东西。 但不知道现在是否维护。