// from JDK-8152421
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.stage.Modality;
import javafx.stage.Stage;

public class DualModal extends Application {

  public static void main(String[] args) {

    Application.launch("xDB CSI");
  }

  @Override
  public void start(Stage primaryStage) throws Exception {

    VBox root = new VBox();
    root.getChildren().add(new Label("Primary Stage"));
    Scene scene = new Scene(root);

    primaryStage.setScene(scene);

    primaryStage.setHeight(200);
    primaryStage.setWidth(200);
    primaryStage.setResizable(true);

    primaryStage.show();

    Stage secondStage = new Stage();

    VBox secondRoot = new VBox();
    secondRoot.getChildren().add(new Label("Secondary Stage"));
    Scene secondScene = new Scene(secondRoot);

    secondStage.setScene(secondScene);

    secondStage.setHeight(100);
    secondStage.setWidth(100);

    secondStage.initModality(Modality.APPLICATION_MODAL);

    secondStage.show();
  }
}
