Example usage for java.awt Dialog Dialog

List of usage examples for java.awt Dialog Dialog

Introduction

In this page you can find the example usage for java.awt Dialog Dialog.

Prototype

public Dialog(Window owner, String title, ModalityType modalityType) 

Source Link

Document

Constructs an initially invisible Dialog with the specified owner Window , title and modality.

Usage

From source file:Main.java

static Window getDialog(Component parentComponent, String title, boolean modal) {
    if (ALWAYS_USE_FRAME)
        return new Frame(title);

    Window dialog;//from   w ww  .  j  a va  2s .c  o m
    Window window = getComponentWindow(parentComponent);
    if (window instanceof Frame) {
        dialog = new Dialog((Frame) window, title, modal);
    } else {
        dialog = new Dialog((Dialog) window, title, modal);
    }
    return dialog;

}