If Swing is deprecated, what is the alternative?

2020-06-30 09:08发布

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?

6条回答
SAY GOODBYE
3楼-- · 2020-06-30 09:15

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.

查看更多
女痞
4楼-- · 2020-06-30 09:18

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.

查看更多
手持菜刀,她持情操
5楼-- · 2020-06-30 09:20

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.

查看更多
看我几分像从前
6楼-- · 2020-06-30 09:36

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

查看更多
成全新的幸福
7楼-- · 2020-06-30 09:40

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]

查看更多
登录 后发表回答