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.
All objects in Swing are derived from AWT, and most objects in Swing start with the letter J. Hint: Oracle has developed JavaFX to replace both Swing and AWT. Since Java SE 7, update 6 it is bundled with Java SE.
In short, Swing and JavaFX are both GUI toolkits for Java programs. Swing is the old standard toolkit that features a bigger library of GUI elements and mature IDE support. JavaFX is the newer standard with a smaller library, more consistent updates, and consistent MVC support.
JavaFX new fixes will continue to be supported on Java SE 8 through March 2022 and removed from Java SE 11. Swing and AWT will continue to be supported on Java SE 8 through at least March 2025, and on Java SE 11 (18.9 LTS) through at least September 2026.
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.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With