java替代swing编程的技术,JavaFX应该取代Swing吗?

I am used to Swing programming and have heard about JavaFX. Is it supposed to replace Swing as the preferred platform for writing desktop applications in Java?

To put it in another way, should I choose JavaFX for my new project?

解决方案

Yes JavaFX is replacing Swing.

See also official documentation of Oracle:

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.

See also SO posts:

I am used to Swing programming and have heard about JavaFX. Is it supposed to replace Swing as the preferred platform for writing desktop applications in Java? To put it in another way, should I choose JavaFX for my new project? 解决方案 Yes JavaFX is replacing Swing. See also official documentation of Oracle: 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. See also SO posts:
经验分享 程序员 微信小程序 职场和发展