This content has been marked as final. Show 4 replies
Okay to be more precise the problem comes up when I remove the JFXPanel and add it again. As part of the code the JFXPanel gets removed and added again, after that the text is updated but as I said the change is not visible. If I don't remove the JFXPanel and add it again the change on the JFXPanel is visible once more .... any idea?
Have you called Platform.setImplicitExit(false)? Although, I'd think a problem there manifests itself with an exception.
Perhaps also make sure you call myjfxpanel.revalidate()/repaint().
I think your problem may be that JavaFX "kills itself" when you exit the last window you have with JavaFX running in it. If you are running JavaFX within a Swing-based application (like Netbeans), this is probably not the same as exiting the application alltogether. However, the JavaFX thread shut down when you close the last JavaFX-window, and it will not start again if you reopen it. I've seen this happen with TopComponents in Netbeans applications, for example.
JavaFX 2.2 added the setImplicitExit method to Platform that can suppress this behavior. It was not present before the 2.2 update. Be aware that you may need to invoke this method on the Swing thread rather than the JavaFX Application thread. Try adding this to your setup:
That was exactly the problem. thank you guys!