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