title: passing variables between scenes using JavaFx
body: <p>I tried almost every available solution but nothing seems to work I need to pass a <code>string</code> between 2 Javafx scenes, but when I click to navigate to the next scene nothing happens. here's my code so far:</p>
  
  <pre><code>String myVariable = "test";
  FXMLLoader loader =new FXMLLoader(getClass().getResource("/fxml/Comments.fxml"));
  Parent root = null;
  CommentsController commentsController = new CommentsController();
  commentsController = loader.getController();
  commentsController.transferMessage(myVariable);
   Stage stage = new Stage();
   stage.setScene(new Scene(root));
   stage.show(); 
  </code></pre>
  
  <p>PS: I have <code>transferMessage()</code> method set-up in the second scene.</p>