generate JavaFX Dialog Stage - Java JavaFX

Java examples for JavaFX:Dialog

Description

generate JavaFX Dialog Stage

Demo Code


//package com.java2s;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Modality;
import javafx.stage.Stage;

public class Main {
    public static Stage generateDialogStage(String title, Parent root,
            Stage primaryStage) {/* w  w  w.  j  ava 2 s.c  om*/
        Stage dialogStage = new Stage();
        dialogStage.setTitle(title);
        dialogStage.initModality(Modality.WINDOW_MODAL);
        dialogStage.initOwner(primaryStage);
        Scene scene = new Scene(root);
        dialogStage.setScene(scene);
        return dialogStage;
    }
}

Related Tutorials