0
我已經在錨點窗格中創建了fxml文件 但每次點擊按鈕我都會在新幀中獲得下一個fxml 我希望它在同一幀是否有可能在同一幀中打開一個新的fxml文件
public void baropen(ActionEvent event) {
// handle the event here
BorderPane bp = new BorderPane();
bp.setPadding(new Insets(10, 50, 50, 50));
Stage stage = new Stage();
Scene scene ;
// scene= new Scene(root);
scene = new Scene(bp);
stage.setScene(scene);
stage.show();
try {
new RecBar().start(stage);
} catch (Exception ex) {
Logger.getLogger(RecController.class.getName()).log(Level.SEVERE, null,ex);
}
}
也許這可以幫助,它將一個FXML文件加載到AnchorPane中:http://stackoverflow.com/questions/14265697/bind-width-and-height-of-dynamically-loaded-fxml – Perneel 2013-02-24 14:59:15