Swing调用javafx 调用方法:
Platform.runLater(new Runnable(){ @Override public void run() { WebView webView = new WebView(); final WebEngine webEngine = webView.getEngine(); webEngine.load(DEFAULT_URL); jfx.setScene(new Scene(webView)); } });
javafx 调用Swing
SwingUtilities.invokeLater(new Runnable() { public void run() { try { UIManager.setLookAndFeel(new SubstanceDustLookAndFeel()); UIManager.put("swing.boldMetal", false); if (System.getProperty("substancelaf.useDecorations") == null) { JFrame.setDefaultLookAndFeelDecorated(true); JDialog.setDefaultLookAndFeelDecorated(true); } } catch (Exception e) { e.printStackTrace(); } new Main_Show().showMySelf(); } });