For a developer in the Java eco-system, there is a handful of choices when it comes to UI design. The best known are:
对于Java生态系统中的开发人员,在UI设计方面有一些选择。最着名的是:
- Swing (preferred when used with Netbeans and its GUI builder)
- Eclipse's SWT (mostly preferred for Eclipse plug-ins)
Swing(与Netbeans及其GUI构建器一起使用时首选)
Eclipse的SWT(最常用于Eclipse插件)
Now, are there any frameworks or design alternatives to this which target JRuby / Groovy / Jython or other "dynamic" JVM languages ?
现在,有没有针对JRuby / Groovy / Jython或其他“动态”JVM语言的框架或设计替代方案?
Some UI frameworks are layers over Swing or SWT, for example, a framework could read a description of a Screen in XML and instantiate the corresponding Swing components.
一些UI框架是Swing或SWT上的层,例如,框架可以读取XML中的屏幕描述并实例化相应的Swing组件。
If you know a framework like that but which targets JVM "dynamic" languages, I'd like to see them in the answers as well.
如果你知道这样的框架,但是针对JVM“动态”语言,我也希望在答案中看到它们。
3 个解决方案
#2
2
Clojure has a few GUI libraries / frameworks that look priomising:
Clojure有一些看起来很简单的GUI库/框架:
seesaw wraps Swing in a very concise DSL, which could certainly be used to declaratively create GUI interfaces:
seesaw在一个非常简洁的DSL中包装Swing,它当然可以用于声明性地创建GUI界面:
(defn -main [& args]
(invoke-later
(-> (frame :title "Hello",
:content "Hello, Seesaw",
:on-close :exit)
pack!
show!)))
Incanter provides quite a lot of graphing and visualisation functionality (wrapping JFreeChart among other things). Not quite a general GUI library, but very useful if you're focusing on stats:
Incanter提供了大量的图形和可视化功能(包括JFreeChart等)。不是一般的GUI库,但如果你专注于统计数据非常有用:
;; show a histogram of 1000 samples from a normal distribution
(view (histogram (sample-normal 1000)))
There is also some neat example code popping up for wrapping JavaFX 2.0 in Clojure - again this is more like a declarative DSL:
还有一些简洁的示例代码用于在Clojure中包装JavaFX 2.0 - 这更像是声明性的DSL:
(defn -start [app stage]
(eval
(fx Stage :visible true :width 300 :height 200 :title "hello world"
:scene (fx Scene
(fx BorderPane :left (fx Text "hello")
:right (fx Text "Right")
:top (fx Text "top")
:bottom (fx Text "Bottom")
:center (fx Text "In the middle!"))))))
#3
0
I think the two most mature frameworks for Jruby are Monkeybars (http://monkeybars.rubyforge.org/) and Limelight (http://limelight.8thlight.com/).
我认为Jruby最成熟的两个框架是Monkeybars(http://monkeybars.rubyforge.org/)和Limelight(http://limelight.8thlight.com/)。
Monkeybars is a full rubyesque MVC implementation which can be used in conjunction with a Swing GUI builder, whereas Limelight goes for a minimal code / maximum effect ratio like Shoes does.
Monkeybars是一个完整的rubyesque MVC实现,可以与Swing GUI构建器一起使用,而Limelight可以像Shoes那样实现最小的代码/最大效果比。
#1
#2
2
Clojure has a few GUI libraries / frameworks that look priomising:
Clojure有一些看起来很简单的GUI库/框架:
seesaw wraps Swing in a very concise DSL, which could certainly be used to declaratively create GUI interfaces:
seesaw在一个非常简洁的DSL中包装Swing,它当然可以用于声明性地创建GUI界面:
(defn -main [& args]
(invoke-later
(-> (frame :title "Hello",
:content "Hello, Seesaw",
:on-close :exit)
pack!
show!)))
Incanter provides quite a lot of graphing and visualisation functionality (wrapping JFreeChart among other things). Not quite a general GUI library, but very useful if you're focusing on stats:
Incanter提供了大量的图形和可视化功能(包括JFreeChart等)。不是一般的GUI库,但如果你专注于统计数据非常有用:
;; show a histogram of 1000 samples from a normal distribution
(view (histogram (sample-normal 1000)))
There is also some neat example code popping up for wrapping JavaFX 2.0 in Clojure - again this is more like a declarative DSL:
还有一些简洁的示例代码用于在Clojure中包装JavaFX 2.0 - 这更像是声明性的DSL:
(defn -start [app stage]
(eval
(fx Stage :visible true :width 300 :height 200 :title "hello world"
:scene (fx Scene
(fx BorderPane :left (fx Text "hello")
:right (fx Text "Right")
:top (fx Text "top")
:bottom (fx Text "Bottom")
:center (fx Text "In the middle!"))))))
#3
0
I think the two most mature frameworks for Jruby are Monkeybars (http://monkeybars.rubyforge.org/) and Limelight (http://limelight.8thlight.com/).
我认为Jruby最成熟的两个框架是Monkeybars(http://monkeybars.rubyforge.org/)和Limelight(http://limelight.8thlight.com/)。
Monkeybars is a full rubyesque MVC implementation which can be used in conjunction with a Swing GUI builder, whereas Limelight goes for a minimal code / maximum effect ratio like Shoes does.
Monkeybars是一个完整的rubyesque MVC实现,可以与Swing GUI构建器一起使用,而Limelight可以像Shoes那样实现最小的代码/最大效果比。