0
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();
    }
}
fabian
  • 80,457
  • 12
  • 86
  • 114
  • A split pane's [`items`](https://docs.oracle.com/javase/9/docs/api/javafx/scene/control/SplitPane.html#getItems--) are ordered as they appear in the split pane. So if this is a horizontal split pane, `mainPane.getItems().set(1, newPane)` will set the second item, reading from left to right. – James_D Apr 12 '18 at 10:49
  • thanks I also did this – Numan Ahmad Apr 15 '18 at 10:51

0 Answers0