tags:

views:

638

answers:

5

I'm planning to work on some hobby Java projects. I've done some small-scale projects, so I'm familiar with the language itself and building a GUI with Swing. I'd like to make my work a little less ad-hoc and perhaps find some tools that might be useful out in the real world.

NetBeans now comes bundled with the Swing Application Framework, which seems to be a very useful tool. It helps bridge the gulf between knowing how to create a JFrame and how to use one effectively in the context of a larger application. The problem being that there are large chunks of the API completely undocumented and there's virtually no documentation on how to use it. There are only two questions in the FAQ, the mailing lists are all but dead, and I can't even tell if the project is being actively developed or if it's been abandoned. I've managed to get up and running with it based largely on the two-year-old JavaOne presentation posted on the project's home page.

Is there a better alternative? Is another tool/library/API out there that does the same sort of thing in a slightly more newbie-friendly way? Note that I'm planning to develop desktop applications at the moment, and am not looking for J2EE frameworks like Spring and Hibernate.

+3  A: 

For a GUI library I'd lean towards SWT. Eclipse maintains it and uses it for its IDE. I believe Azureus used it too. Looks good on multiple platforms and pretty easy to use.

Parrots
SWT isn't a GUI framework, it's a widget toolkit. Moreover, it's a complete alternative to Swing. I believe `eaolson` is looking for more of a desktop equivalent of web frameworks such as Struts, Wicket, etc. If he does use SWT, then he should consider Eclipse RCP, which _is_ a full framework.
jaaronfarr
+3  A: 

For more complete frameworks:

The NetBeans platform perhaps http://www.netbeans.org/kb/trails/platform.html

Or the Eclipse RCP http://www.eclipse.org/articles/Article-RCP-1/tutorial1.html

OscarRyz
+2  A: 

The basic principles for creating a good desktop are the same for creating web or enterprise applications. So the core of Spring or other frameworks such as OSGi or PicoContainer can easily be used outside of J2EE. For example, Eclipse uses OSGi as its internal framework. The original use of the Model-View-Presenter (MVC) pattern was for Smalltalk GUI widgets.

In fact, for myself, I first found and worked with "IoC" frameworks (long before Spring) precisely because I was looking for a framework and organizing principles for desktop application development.

Update on RCP

I see some people are recommending Eclipse RCP or Netbeans. I've done quite a bit of Eclipse RCP development and for certain classes of applications, it's great. However, the learning curve is very steep and the feature set may be way more than you need. Keep that in mind for any framework you investigate.

jaaronfarr
I've used Eclipse in the distant past as an IDE and have been using Netbeans lately, which is where I found the Spring AF in the first place.
eaolson
A: 

You could also use the Java bindings of Qt. Qt is a multi-platform C++ framework which has, in my opinion, one of the most readable object models for GUI design.

Have a look at the Trolltech (Nokia) Qt website.

You can see a demo (which also has source code) using the Java Web Start feature. It gives a good impression about what can and can't be done, and how the source code looks.

extraneon
+1  A: 

If i were starting a Java based desktop application today, i would use JavaFX.

http://en.wikipedia.org/wiki/JavaFX

joekutner