4

For a developer in the Java eco-system, there is a handful of choices when it comes to UI design. The best known are:

  • Swing (preferred when used with Netbeans and its GUI builder)
  • Eclipse's SWT (mostly preferred for Eclipse plug-ins)

Now, are there any frameworks or design alternatives to this which target JRuby / Groovy / Jython or other "dynamic" JVM languages ?

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.

If you know a framework like that but which targets JVM "dynamic" languages, I'd like to see them in the answers as well.

Matthew Murdoch
  • 30,874
  • 30
  • 96
  • 127
Leonel
  • 28,541
  • 26
  • 76
  • 103

3 Answers3

7

Not exactly UI design, but you could try Griffon.

Michael Myers
  • 188,989
  • 46
  • 291
  • 292
2

Clojure has a few GUI libraries / frameworks that look priomising:

seesaw wraps Swing in a very concise DSL, which could certainly be used to declaratively create GUI interfaces:

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

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

(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!"))))))
mikera
  • 105,238
  • 25
  • 256
  • 415
0

I think the two most mature frameworks for Jruby are Monkeybars (http://monkeybars.rubyforge.org/) and 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.

NielsK
  • 6,886
  • 1
  • 24
  • 46