Loading new fxml in the same scene

Why your code does not work The loader creates a new AnchorPane, but you never add the new pane to a parent in the scene graph. Quick Fix Instead of: content = (AnchorPane) FXMLLoader.load(“vista2.fxml”); Write: content.getChildren().setAll(FXMLLoader.load(“vista2.fxml”)); Replacing the content children with your new vista. The content itself remains in the scene graph, so when you … Read more