title: JavaFX: how to test easy JavaFX Apps with Junit and netbeans
body: <p>I am looking for a simple possibility to test little JavaFX Apps with JUnit and Netbeans. I tried without success to test with JUnit, but it is said that it is not possible to handle the Javafx application thread...</p>
  
  <p>Is there another easy possibility to test Javafx Tools with a another easy tool just without programming??</p>
  
  <p>I hope I do not ask silly questions ....</p>
  
  <p>Here is a demo FX Code that I want to test</p>
  
  <pre><code>public class MyClass extends Application {
  
  @Override
  public void start(Stage primaryStage) {
      Button btn = new Button();
      btn.setText("Say 'Hello World'");
      btn.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
  
          @Override
          public void handle(ActionEvent event) {
              System.out.println("Hello World!");
          }
      });
  
      StackPane root = new StackPane();
      root.getChildren().add(btn);
      Scene scene = new Scene(root, 300, 250);
      primaryStage.setTitle("Hello World!");
      primaryStage.setScene(scene);
      primaryStage.show();
  }
  
  public static void main(String[] args) {
      launch(args);
  }
  </code></pre>
  
  <p>}</p>