Settings

Theme

Why should JS coders have all the fun?

squery.posterous.com

31 points by shahriarhaque · 10 comments

Reader

4 threads
tomjen3

I haven't seen anybody write new Swing GUIs like he did in quite some time. First of all, you don't have to declare the listeners on the form class, and you typically would create an anonymous that listens to each component.

Second, there is a library called swixml (http://www.swixml.org/) which allows you to write the GUI part of the code in a declarative manner and have the library wire the two things together.

Both makes it much less of a pita to write GUIs in Java.

  • raju

    Agreed. I did quite a bit of Swing development a few years ago.

    There is also Griffon (http://griffon.codehaus.org/) that is a MVC (Rails like) framework for Swing apps that uses Groovy. I haven't used it, but from what I have seen, it does make it easier to work with Swing.

    I had not heard of swixml. Thanks for the pointer.

DanielRibeiro

Even in java ecosystem, there are several tools that make gui desing easier: Swing builder in groovy (http://groovy.codehaus.org/Swing+Builder), Scala Swing Dsl (http://stackoverflow.com/questions/1570175/scala-and-swing-g...), Cheri for jruby (http://objectmix.com/ruby/251973-cheri-builder-style-jruby-s...), and the list goes on.

But it's good to see the effort on Java as well, which can do DSLs as well, even those these are easier on languages that actively support them, such as scala, groovy, ruby, clojure, ...

  • jamesbritt

    I seriously do not understand why people don't just use the free GUI builder that comes with Netbeans, then wire up the resulting classes.

    And wiring them up doesn't get any easier than using JRuby with Monkeybars (http://monkeybars.org). Yes, I'm biased, I'm the project leader. But still. :)

    DSLs and such are nice for smallish UIs, but once you get to anything remotely sophisticated tweaking text files to sort out alignment, flow, balance, etc. is crazy. (And double crazy if those text files are XML.)

    • DanielRibeiro

      Great link. I knew monkeybars once, but totally forgo about it. It seems complement swing with what glade does to gtk (and its code generators do, from taking xml and turning into python/ruby/perl,etc files).

lsb

As a Java-for-pay programmer, I'm not extremely experienced in the Java ecosystem; why use Swing to make a GUI instead of using HTML?

heresy

Ugh, casting.

Is the use of generics in Java still not common?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection