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) {/*ww w .ja v a  2  s  .  co m*/
        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