java - JavaFX error when ending Swing application -
i have swing application in need display internally generated html/css. in order this, have adapted the code stackoverflow question.
the control works fine. however, when application ends, receive error
# # fatal error has been detected java runtime environment: # # sigsegv (0xb) @ pc=0x00007f9622171ae8, pid=5782, tid=140283095549696 for it's worth, sample code directly oracle (quoted in stackoverflow post) has same problem.
i have tried explicitly calling platform.exit() when window closes, error remains. so, how 1 shut down javafx correctly, when embedded in swing application?
ok, found solution, @ least application:
this multi-window application; javafx component not in main application window, in sub-window.
the javafx "platform" has setting "implicitexit", default "true".
javafx platform.exit() apparently called both when sub-window closed, , when main application closed. second call (when application closed) generates error message described in original question.
the "implicit exit" behavior in case undesirable, because prevents sub-window being re-opened second time during application's lifetime.
hence, solution turn off "implicit exit". here's javafx initialization code in subwindow:
platform.runlater(new runnable() { @override public void run() { view = new webview(); engine = view.getengine(); jfxpanel.setscene(new scene(view)); platform.setimplicitexit(false); // otherwise cannot open report window second time } });
Comments
Post a Comment