If Swing is deprecated, what is the alternative?
Asked Answered
U

6

23

I heard that apparently Swing is being developed no longer. I like Swing and use it all the time.

What should I now be using instead?

Unreflecting answered 29/4, 2011 at 6:20 Comment(2)
Although Oracle has much reduced the work on Swing (apparently, seen from an outsider), the "new Swing" JavaFX (I don't like this way to call it actually because it has almost no commonalities with Swing) is, from my point of view, not ready yet for primetime. I'm sure Swing has still a long life to live (at least 2 or 3 more years).Perigynous
Related: "Is JavaFX complete replacement of Swing?" #15363283Isaak
R
32

I never heard such thing and still developing swing apps. Don't give wings to rumors. But as an alternative you can use JavaFx or swt or buoy.

Roadhouse answered 29/4, 2011 at 6:22 Comment(4)
In the Netbeans IDE help file, if you search for 'swing' you will find a page titled 'about the swing application framework'. It says: 'The swing application framework (JSR 296) is no longer developed and will not become part of the official java development kit as was originally planned. It is still included in the IDE and you can use this library as it is, but no further development is expected. Blah blah...' It suggests to use the netbeans platform instead (which I suppose answers my question, but I have no idea what the netbeans platform is).Unreflecting
@Dean: The application framework was a JSR planned for Java 7, now deferred. It is not Swing, but rather a planned enhancement to make building Swing applications much easier.Andaman
Oh! I guess I was confused about the whole thing. Thanks for sorting this out for me.Unreflecting
That's a very unfortunate name for Swing. Dean isn't the first one here to confuse those two.Chirpy
R
16

You probably read something about the 'Swing Application Framework', which while built using Swing, is not 'Swing'.


From Swing Application Framework - Status and Roadmap.

Development on an open source Reference Implementation called appframework was begun in 2006.[1] It was originally expected that this implementation would be the means for integrating JSR 296 into the upcoming Java SE 7 (Dolphin) version of the Java programming language, and the project was scheduled to be included in milestone 5 of the JDK7 development. However, in August 2009, it was announced that the project would not be included due to an inability to reconcile design flaws and achieve consensus among the JSR 296 team before the milestone 5 deadline.[2]

The original Swing Application Framework implementation has been put on hold indefinitely.[3] The last public release of the appframework project is version 1.03.[1]

Rosalindarosalinde answered 29/4, 2011 at 6:34 Comment(1)
But SAF has been forked since that time and still exists under the name "BSAF". The project still seems active nowadays.Perigynous
S
7

Jan 2019 Latest

For reference, AWT & Swing have been moved to java.desktop since Java SE 9. You can watch for future changes here. JavaFX (added to JDK since 8) was removed from the official JDK in Java 11. So its hard to say what is "official" anymore. However JavaFX's development has increased since the decoupling, with its new home here.

Soave answered 16/1, 2019 at 23:13 Comment(0)
G
6

Older question, but worth a reference:

Is JavaFX replacing Swing as the new client UI library for Java SE?

Yes. However, Swing will remain part of the Java SE specification for the foreseeable future, and therefore included in the JRE. While we recommend > developers to leverage JavaFX APIs as much as possible when building new applications, it is possible to extend a Swing application with JavaFX, allowing for a smoother transition.

http://www.oracle.com/technetwork/java/javafx/overview/faq-1446554.html#6

Grape answered 19/3, 2015 at 11:10 Comment(0)
E
1

The Standard Widget Toolkit.

Existence answered 29/4, 2011 at 6:22 Comment(0)
M
0

There is nothing wrong with swing. Personally i don't like SWT. You have to read input-values from widgets and store them in normal variables before a dialog is disposed.

Minutiae answered 29/4, 2011 at 6:35 Comment(1)
If you were using SWT, you can use JFace as well. It provides a set of viewers (model driven) similar to a lot of Swing models.Incurve

© 2022 - 2024 — McMap. All rights reserved.