JavaFX IllegalStateException when processing jfxpanel in swing

I just came across something strange about JavaFX and swing

When processing a JavaFX panel that has been added to a JFrame or JPanel, adding a new jfxpanel will throw an IllegalStateException: "platform.exit has been called"

In my case, this happens when I delete some jpanels and jfxpanels, and then try to add them again

Solution

Fortunately, I found a solution in Oracle forum

In JavaFX 2.2, add the following line to the main class:

Platform.setImplicitExit(false);

This has been done in my application, and I hope it can help some of you

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>