4 ms·
Why should JS coders have all the fun?
- tomjen3 16y agoI 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/ 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 16y agoAgreed. I did quite a bit of Swing development a few years ago. There is also Griffon (http://griffon.codehaus.org/ 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.
- lsb 16y agoAs 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?
- wlievens 16y agoSwing for desktop apps, HTML for webapps, I guess.
- calcnerd256 16y agoI yearn for the day when we laugh at that mindset.
- DanielRibeiro 16y agoEven in java ecosystem, there are several tools that make gui desing easier: Swing builder in groovy (http://groovy.codehaus.org/Swing+Builder http://groovy.codehaus.org/Swing+Builder), Scala Swing Dsl (http://stackoverflow.com/questions/1570175/scala-and-swing-gui-applications http://stackoverflow.com/questions/1570175/scala-and-swing-g...), Cheri for jruby (http://objectmix.com/ruby/251973-cheri-builder-style-jruby-swing-gui-development.html 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 16y agoI 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 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 16y agoGreat 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).
- megafotze 16y agojs and coders? sorry, but whoever vomits JS over his keyboard is not to be called a coder.
- heresy 16y agoUgh, casting. Is the use of generics in Java still not common?