Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which Java GUI framework to choose now? [closed]

Which GUI framework/library would you choose if you were to start your new project now or in the near future?

It has to be free for commercial use and cross platform.

I have been a happy swing user, but Sun seems like pushing swing to deprecation, while pushing Javafx, which is not yet ready for prime time.

There's also SWT, but it seems like it has issues on Linux.

What is your Gui library/framework of choice?

EDIT: Sun has canceled swingx project. From the forum comments on http://swingx.dev.java.net seems like majority of Sun resources that previously worked on core swing are now developing JavaFx full time.

like image 763
Marko Avatar asked Nov 11 '08 16:11

Marko


People also ask

Which is better Java Swing or JavaFX?

From a Java developer perspective, both technologies are highly useful in writing pluggable UI components. With its vast UI component library, Swing can provide added advantage to the developer, whereas when it comes to design modern and rich internet application, JavaFX can supersede Swing.

What is the latest Java GUI?

JavaFX. JavaFX is the latest Flagship of Java/Oracle replacing Swing, promising to be the new standard in creating rich desktop and web applications. Majority of the new Java GUI programs being developed in the last decade have been using JavaFX.

Is Java Swing still in use?

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.


1 Answers

I think that despite Sun's mismanagement, Swing is still an excellent framework. You can do a lot with it, especially if that "lot" involves custom rendered UI controls. If your application needs a branded LAF, or even just a few complex custom controls here and there, Swing is exactly what you want.

On the other side of the coin, I do like SWT quite a lot. It gets a bad rap because everyone used to think it was IBM's ploy to take over Java, but it's really just another UI framework that is quite complementary to Swing. I would not advise using SWT for super-complex graphics rendering (specifically: compositing) or for creating really non-trivial custom controls, but for everything else it is really dandy. The API itself gets a lot of criticism because of things like reliance on bit masks and a user-managed event dispatch loop, but most of those things are pretty transparent once you get used to them. The components themselves are a lot simpler than Swing's (in terms of extensibility and similar), which means that the API can be proportionally simpler. I can actually remember how to create and populate a table in SWT; whereas I don't think I have ever handled that in Swing without Google's assistance.

SWT's biggest problem right now is the stable version depends on Carbon on Mac OS X. This means that SWT apps can only run 32bit on Java 5 (or 32bit on SoyLatte). As for other platforms, SWT is phenomenal on Windows (Vista and XP) and almost as good on GTK Linux. I have not (in recent past) had any issues with SWT on Linux, so I'm a bit surprised that you would mention it as a sore point.

Coming back to your question: it all depends on what your application needs. If it's a flashy custom-styled application with tons of custom controls and complex compositing, Swing is the only game in town. However, if a simpler API is more important to you, or if your users demand the ultimate in platform LAF fidelity, SWT is the best choice.

like image 146
Daniel Spiewak Avatar answered Sep 19 '22 15:09

Daniel Spiewak