Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is executed:
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- new JFXPanel(); //Somehow prepares the JavaFX toolkit
- // Other stuff is done here
- Platform.runLater(new Runnable() {
- public void run() {
- test(); // The code below
- }
- });
- }
- });
- /////////////////////////////////////////////////////
- void test() {
- JFXPanel jfx = new JFXPanel();
- final JFrame dialog = new JFrame();
- dialog.setTitle("I'm a dialog");
- BorderPane root = new BorderPane();
- dialog.setSize(880, 550);
- dialog.setResizable(false);
- Scene ds = new Scene(root);
- jfx.setScene(ds);
- dialog.add(jfx);
- dialog.setVisible(true);
- WebView browser = new WebView();
- browser.setDisable(true);
- WebEngine webEngine = browser.getEngine();
- webEngine.load("http://www.example.com"); //When commenting this line out, the crash does not occur.
- root.setCenter(browser);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement