Source of MyJavaFX.java


  1: 
  2: import javafx.application.Application;
  3: import javafx.scene.Scene;
  4: import javafx.scene.control.Button;
  5: import javafx.stage.Stage;
  6: 
  7: public class MyJavaFX extends Application {
  8:   @Override // Override the start method in the Application class
  9:   public void start(Stage primaryStage) {
 10:     // Create a button and place it in the scene
 11:     Button btOK = new Button("OK");
 12:     Scene scene = new Scene(btOK, 200, 250);
 13:     primaryStage.setTitle("MyJavaFX"); // Set the stage title
 14:     primaryStage.setScene(scene); // Place the scene in the stage
 15:     primaryStage.show(); // Display the stage
 16:   }
 17: 
 18:   /**
 19:    * The main method is only needed for the IDE with limited
 20:    * JavaFX support. Not needed for running from the command line.
 21:    */
 22:   public static void main(String[] args) {
 23:     launch(args);
 24:   }
 25: }