Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a better Java application framework than Swing?

Tags:

java

saf

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.

like image 895
eaolson Avatar asked Feb 14 '09 03:02

eaolson


People also ask

What is replacing Java Swing?

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.

Is JavaFX better than Swing?

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.

Is Java Swing still used in 2022?

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.


3 Answers

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.

like image 59
jaaronfarr Avatar answered Oct 27 '22 10:10

jaaronfarr


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

like image 21
OscarRyz Avatar answered Oct 27 '22 10:10

OscarRyz


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.

like image 38
Parrots Avatar answered Oct 27 '22 11:10

Parrots