tags:

views:

995

answers:

6

I write applications in Java, and I'm looking for ways to speedup GUI programming. Binding frameworks help, but the particular application I'm working on now wouldn't benefit too much from that (it doesn't display a lot of data, just a lot of ways to manipulate the data). I feel like I spend way too much time writing boiler-plate GUI code, like adding action listeners, laying out components, etc. While I'm not a C# developer, I've heard XAML works very well and have seen JAXX, which appears to be similar to XAML. I'm also looking at the Groovy Swing Builder. It just seems like there are so many options, maybe even too many.

Can anyone share their thoughts on alternatives to hand writing simple Java UI code?

Also, I'd be interested in discussing how to migrate existing Java Swing code to use some of these options.

thanks, Jeff

A: 

I'm no expert in GUI programming, but have you tried using NetBeans as a platform for your app?

tim_wonil
It seems to be for larger applications. It might be counterproductive. See this "intro": http://netbeans.dzone.com/videos/free-netbeans-platform-crash
OscarRyz
+3  A: 

I recommend using Clojure It allows you to write Java GUIs quickly without the boilerplate.

Timothy Pratley
looks similar to the Groovy SwingBuilder
Jeff Storey
+2  A: 

You should definitely use an IDE with GUI builder.

IntelliJ IDEA and NetBeans have very good GUI builders, they allow you to automatically bind objects and would reduce tremendously the amount of effort needed to create a GUI as opposed of doing it completely by hand.

OscarRyz
As a fan of UI builders I do feel I should add - If you use one don't throw good standards out of the window. When you add a widget always name it well and avoid the double-click-auto-add-listener rubbish.
mlk
+3  A: 

Layouts:

For layouts, I have abandoned the JDK Layout Managers in favor of the JGoodies Forms tool. I find it much more effective. It reads at a higher level, and reduces significantly the amount of code related to layouts.

John O
Agreed. I use that as well. Definitely helps.
Jeff Storey
DesignGridLayout can also help a lot for the layout aspects, if you have only forms in your UI.
jfpoilpret
+1 for JGoodies Forms
Pascal Thivent
+1  A: 

I agree with others that tying down to NetBeans seems dangerous - especially when working with other developers. I've used the (commercial) Swing Designer (by "instantiations") plugin for Eclipse with quite a lot of success - the thing I like about it is that it round-trips, generating code that you are free to alter by hand. Not perfect, but a good time-saver.

But the biggest difference in my Swing programming came with the discovery of better layout managers. I went from FormLayout (good), to TableLayout (better), but now I don't use anything but MiGLayout (incredible).

CarlG
+2  A: 

How about using MiGLayout?

It is extremely simple to learn and use. I strongly recommend it to you. In my last project, it helped me to reduce much time to implement lots of GUI.

xrath
I'll check that out. thanks.
Jeff Storey