相关疑难解决方法(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);
    }
}
Run Code Online (Sandbox Code Playgroud)

java javafx javafx-2

0
推荐指数
1
解决办法
1017
查看次数

标签 统计

java ×1

javafx ×1

javafx-2 ×1