如何在splitpane的childpane,左或右子窗格中加载fxml?

时间:2018-04-12 06:58:30

标签: javafx splitpane

public void startQuiz(ActionEvent ae) {

    try {
        mainPane.setVisible(true);//main splitpane      
        AnchorPane newPane = (AnchorPane) FXMLLoader.load(getClass().getResource("TestFXML.fxml"));
        mainPane.getItems().set(1, newPane);//don't know loading in either left or right Anchorpane
        labelPane.setVisible(false);//previous child pane to hide
        mainPane.setVisible(true);
        menuPane.setVisible(true);//right pane
    } catch (Exception ex) {//`errors is in loading pane`
        errorAlert.setContentText("" + ex);
        errorAlert.show();
    }
}

0 个答案:

没有答案