Multiple Windows

Create multiple stages

// Windows.java
//    Displays several windows with warm, friendly greetings.

import javafx.application.*;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.stage.*;

public class Windows extends Application {
  final int n = 5;
  
  public void start(Stage stage) {
    Label[] labels  = new Label[n];
    BorderPane[] panes = new BorderPane[n];
    Scene[] scenes = new Scene[n];
    Stage[] stages = new Stage[n];

    // Create extra windows.
    stages[0] = stage;
    for (int i = 1; i < n; i++) {
      stages[i] = new Stage();
    }
    
    for (int i = 0; i < n; i++) {
      // Create a label.
      labels[i] = new Label("Hello, world!\nStage" + i);

      // Create a pane to hold the label.
      panes[i] = new BorderPane();
      panes[i].setCenter(labels[i]);

      // Create a scene.
      scenes[i] = new Scene(panes[i], 200, 200);

      // Set up the stage and make it visible.
      stages[i].setTitle("Hello World!");
      stages[i].setScene(scenes[i]);
      stages[i].show();
    }
  }

  public static void main(String[] args) {
    launch(args);
  }
}