2011-03-06 40 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是我用過的一樣東西。 但不知道現在是否維護。