title: Changing Scenes in JavaFX NullPointerException
body: <p>I'm wanting to change to a scene in another class but I'm having great difficulty.</p>
  
  <p>Now the I can move to the to the second screen no problem, but moving back to the first screen gives me the <strong>NullPointerException</strong>.</p>
  
  <p>Help would be much appreciated. Many thanks in advance.</p>
  
  <p><strong>Main Class</strong></p>
  
  <pre><code>public class Main extends Application {
  
  Stage ps;
  Group root = new Group();
  Scene s = new Scene(root, 300, 300, Color.AQUA);
  Controller con = new Controller();
  
  
  public void start(Stage primaryStage) throws Exception {
      ps = primaryStage;
      con.buttonLayout();
      buttonLayout();
  
      primaryStage.setTitle("Hello World");
      ps.setScene(s);
      primaryStage.show();
  }
  
  public void buttonLayout() {
      Button but = new Button("first");
  
      but.setOnMouseClicked(new EventHandler&lt;MouseEvent&gt;() {
          @Override
          public void handle(MouseEvent event) {
              ps.setScene(con.s);
          }
      });
  
      root.getChildren().add(but);
  }
  
  
  public static void main(String[] args) {
      launch(args);
  }
  }
  </code></pre>
  
  <p><strong>Other class</strong></p>
  
  <pre><code>public class Controller{
  Group root = new Group();
  Scene s = new Scene(root, 300, 300, Color.BLACK);
  
  
  public void buttonLayout() {
      Button but = new Button("back to first");
  
      but.setOnMouseClicked(new EventHandler&lt;MouseEvent&gt;() {
          @Override
          public void handle(MouseEvent event) {
              Main main = new Main();
              main.ps.setScene(main.s);
          }
      });
  
      root.getChildren().add(but);
  }
  }
  </code></pre>