title: How to pass an ArrayList from one Scene to another in JavaFX 2?
body: <p>So I've been trying for hours to solve this and it has been answered before in these forums but I would really appreciate some help since none really address my issue specifically or propose very differing solutions and I'm not quite sure what to try (even though I've tried all of them, I daresay). </p>
  
  <p>The issue is this: I have a JavaFX application with 6 Scenes and their respective Controllers. I have a Person class that creates an object and that object I would like to store in an ArrayList that's global (that is, accessible by all the Scenes) so that when I close the application I can call another method to save it to a serialized file. </p>
  
  <p>I don't actually use the ArrayList in the first couple of scenes because they're menus, so the actual method of creating the object is not run until the third Scene or so.</p>
  
  <p>I have successfully created the Scenes and I can switch between them, I just have no idea</p>
  
  <ol>
  <li>Where to declare the ArrayList (if in the main method, the main Class or where?)</li>
  <li>How to pass this ArrayList between the Scenes so that they will all be able to access them.</li>
  </ol>
  
  <p>I currently use this Class to switch between the Scenes:</p>
  
  <pre><code>public class SelectScene  {
      public void setScene(String fxmlFileName, String title, ActionEvent event) throws IOException{
          Stage stage = (Stage) ((Node)event.getSource()).getScene().getWindow();
          Parent root = FXMLLoader.load(getClass().getResource(fxmlFileName));
          Scene scene = new Scene(root);
          scene.getStylesheets().add(FinalDossier.class.getResource("style.css").toExternalForm());
          stage.setTitle(title);
          stage.setScene(scene);
      }
  </code></pre>
  
  <p>I appreciate any help :)</p>