title: How can a dynamically generated JavaFX scene be changed in a single stage?
body: <p>I'm currently working on a project requiring me to switch back and forward between scenes. I have already written some code for it but it isn't as elegant as I wanted to be, especially as there is few flickers when I switch between them and sometimes even the buttons that I have generated simply disappear only to appear once again when yet another scene has been generated. Moreover, the layout I'm using for my application isn't really fixed and I think that using FXML might be not suitable for what I'm doing. </p>
  
  <p>Thank you.</p>
  
  <p>This  is what I'm using to change between scenes:</p>
  
  <pre><code>void changeScene(Stage stage,Scene scene){
      stage.setScene(scene);
      primaryStage.setFullScreen(true);
  }
  </code></pre>