title: JavaFX child AnchorPane not showing after adding to parent AnchorPane
body: <p>So I am working on building an application that is kind of like an IDE, think Eclipse or Netbeans. I want to have different zones where users can select something like a view that will show up in one of the zones. My first attempt is to add a console view to on of my zones. In my application class I create the overall UI with the following code: </p>
  
  <pre><code>public void initialize() {
      try {
          mainController = (MainController) replaceSceneContent("/layout/main.fxml");
      }catch (Exception ex) {
          Logger.getLogger(MyApplication.class.getName()).log(Level.SEVERE, null, ex);
      }
  }
  
  private Initializable replaceSceneContent(String fxml) throws Exception {
  
      FXMLLoader loader = new FXMLLoader();
      InputStream in = MyApplication.class.getResourceAsStream(fxml);
      loader.setBuilderFactory(new JavaFXBuilderFactory());
      loader.setLocation(MyApplication.class.getResource(fxml));
  
      AnchorPane page;
      try {
          page = (AnchorPane) loader.load(in);
      } finally {
          in.close();
      } 
  
      Scene scene = new Scene(page);
      stage.setScene(scene);
      stage.sizeToScene();
  
      return (Initializable) loader.getController();
  }
  </code></pre>
  
  <p>Which results in the following UI
  <img src="https://i.stack.imgur.com/xydGt.png" alt="enter image description here"></p>
  
  <p>I would then like to add a console widget/view to the southEast quadrant of the application. This will be handled by the MainController. In theory if someone chooses the Console view it will popup in one of the quadrants, but for now I just want to load it at start up. I try to do this with the following code:</p>
  
  <pre><code>public class MainController extends AnchorPane implements Initializable{
  
  @FXML
  SplitPane west, east;
  @FXML
  AnchorPane northWest, southWest, northEast, southEast, applicationHeader;
  @FXML
  MenuBar menuBar;
  
  Stage stage;
  
  @Override
  public void initialize(URL arg0, ResourceBundle arg1) {
      try {
          ConsoleWidget cw = (ConsoleWidget)loadWidget("/widget/console.fxml");
          southEast.getChildren().add(cw);
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  
  private Initializable loadWidget(String fxml) throws Exception {
  
      FXMLLoader loader = new FXMLLoader();
      InputStream in = MainController.class.getResourceAsStream(fxml);
      loader.setBuilderFactory(new JavaFXBuilderFactory());
      loader.setLocation(MainController.class.getResource(fxml));
  
      AnchorPane page;
      try {
          page = (AnchorPane) loader.load(in);
      } finally {
          in.close();
      } 
  
      return (Initializable) loader.getController();
  }
  }
  </code></pre>
  
  <p>This should result in the following console appearing in the south east quadrant. 
  <img src="https://i.stack.imgur.com/30FSc.png" alt="enter image description here"></p>
  
  <p>Programatically this seems to work. My southEast anchor pane shows that it has 1 child in its list if you look at it, however my <strong>UI doesnt change.</strong> I need to know how to refresh my Main controller (or do whatever I need to do) to make the change show up to the user. </p>
  
  <p>I have created applications before where I create an entire new scene as the user goes through different pages but I have never really done something like this where I need to update the scene after adding a node to a pane. I have tried things like stage.sizeToScene() to try to refresh it but that hasnt worked for me. </p>