title: Javafx how to switch scenes correctly?
body: <p>I've been looking everywhere on the Internet but I couldn't find a straight answer for this simple question: What is the best way to switch scenes in a JavaFX Application?
  I have a few FXML files and Controller for each of them and I wish to be able to switch between them as fast as possible (The screen size should stay the same, everything about the window should stay the same except the content).</p>
  
  <p>There are a number of ways I could think off, the most common way is to load the FXML file with the FXMLLoader and then create a new Scene and then set this Scene the Stage and finally show the Stage. This works but it doesn't seem efficient to me because each time I switch pages the program has to create a whole new scene and then assign it to the Stage. Why is this method the most in used?</p>
  
  <pre><code>Parent root = FXMLLoader.load(getClass().getResource("newPage.fxml"));
  Stage.setScene(new Scene(root));
  Stage.show();
  </code></pre>
  
  <p>I've found another way which is simply to change the root of the current scene (so basically replace the FXML file of the scene with the new one). This seems to be a little bit faster and less laggy but is it a good way of doing things?</p>
  
  <pre><code>Parent root = FXMLLoader.load(getClass().getResource("newPage.fxml"));
  Stage.getScene().setRoot(root);
  Stage.show();
  </code></pre>
  
  <p>What is the best way to switch between pages (scenes)? </p>