Burak Dede
Burak Dede

Reputation: 3743

How to mix Java Swing and JavaFX in Swing application?

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?

Upvotes: 4

Views: 4578

Answers (2)

jsight
jsight

Reputation: 28469

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.

Upvotes: 6

JimClarke
JimClarke

Reputation: 1409

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.

Upvotes: 1

Related Questions