I am trying to use JavaFx 2.x and Swing application by using a JInternalFrame in which attach a JFXPanel
My code below
public class InternalFrameWith
See the 'JavaFX in Swing' tutorial. You are performing JavaFX operations which should run on the JavaFX thread on the Swing thread (Event Dispatch Thread).
Luckily they learnt from their previous mistakes and now throw exceptions when you perform operations on the wrong thread. That is the exception you encountered.
Use the Platform#runLater
as shown in that tutorial
Platform.runLater(new Runnable() {
@Override
public void run() {
//javaFX operations should go here
}
});
The construction of the JFXPanel
can remain on the EDT (which is also illustrated in that tutorial)