【发布时间】:2013-02-23 10:11:51
【问题描述】:
我在锚窗格中创建了 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);
}
}
【问题讨论】:
-
也许这会有所帮助,它会在 AnchorPane 中加载 FXML 文件:stackoverflow.com/questions/14265697/…