title: JavaFX method reference event handling
body: <p>Theoretically this method reference should work but it doesn't. What am I doing wrong? </p>
  
  <p>It does however work if I replace the method reference with a lambda expression: </p>
  
  <p>btn.setOnAction(e-> btnPush());</p>
  
  <pre><code>import javafx.event.ActionEvent;
  import javafx.event.EventHandler;
  import javafx.scene.Scene;
  import javafx.scene.control.Button;
  import javafx.scene.control.Label;
  import javafx.scene.layout.Pane;
  import javafx.scene.layout.StackPane;
  import javafx.scene.paint.Color;
  import javafx.stage.Stage;
  
  
  public class NewFXMain extends Application {
  
      @Override
      public void start(Stage primaryStage) {
  
      Button btn = new Button("Test Button");
      btn.setOnAction(this::btnPush());
  
      Pane root = new Pane();
      root.getChildren().add(btn);
  
      Scene scn = new Scene(root,300,300);
  
      primaryStage.setTitle("Method Reference Test");
      primaryStage.setScene(scn);
      primaryStage.show();  
  
      }
  
    private void btnPush(){
          System.out.println("button pressed");
  
          }
  
      public static void main(String[] args) {
          launch(args);
      }
  
  }
  </code></pre>