How to mix Java Swing and JavaFX in Swing application?

被刻印的时光 ゝ 提交于 2019-12-09 00:52:18

问题


I am developing a Java Swing application but I want to also use JavaFX with Swing. Is there any resource for that told how to do that?


回答1:


See here. The short story is that embedding JavaFX in Swing is now possible and supported via JFXPanel, but the other direction is not supported.




回答2:


The "JavaFX in Swing" link given above only works with JavaFX 1.1. Here is how to do it in JavaFX 1.2 JavaFX in Swing - 1.2. However, as Rastislav mentioned above, this is also using private APIs and will most likely break in the next major version. JFXtras has added some classes to support this, and hopefully, this will insulate the developer from the underlying release changes.



来源:https://stackoverflow.com/questions/1336628/how-to-mix-java-swing-and-javafx-in-swing-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!