2016-05-17 4 views

答えて

0

パブリッククラスNewTestDlg {

final JFXPanel fxPanel = new JFXPanel(); 
Stage stage; 

public void ShowDialog() { 

    Platform.setImplicitExit(false); 

    // create JavaFX scene 
    PlatformImpl.startup(() -> { 
     Parent root; 
     try { 
      stage = new Stage(); 
      stage.setTitle("New Test"); 
      BorderPane pane = new BorderPane(); 
      FXMLLoader loader = new FXMLLoader(getClass().getResource("NewTestDlg.fxml")); 
      loader.setClassLoader(this.getClass().getClassLoader()); 
      root = (Parent) loader.load(); 
      Scene scene = new Scene(root, 610, 345); 
      fxPanel.setScene(scene); 
      stage.setScene(scene); 
      stage.show(); 
     } catch (Exception ex) { 
      System.err.println(ex.getMessage()); 
      System.err.println("Exception in ShowDialog"); 
      ex.printStackTrace(); 
     } 
    }); 

} 

}

に感謝します
関連する問題