Example usage for java.awt Dialog isVisible

List of usage examples for java.awt Dialog isVisible

Introduction

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

Prototype

@Transient
public boolean isVisible() 

Source Link

Document

Determines whether this component should be visible when its parent is visible.

Usage

From source file:util.ui.UiUtilities.java

/**
 * Gets the last visible modal child dialog of the specified window.
 * <p>//w w w .  ja v a2 s.c  o m
 * If there is no visible modal child the window itself will be returned.
 *
 * @param parent
 *          The window to get the child from.
 * @return the last visible modal child dialog of the specified window.
 */
public static Window getLastModalChildOf(Window parent) {
    Window[] children = parent.getOwnedWindows();
    for (Window child : children) {
        if (child instanceof Dialog) {
            Dialog dlg = (Dialog) child;
            if (dlg.isVisible() && dlg.isModal()) {
                return getLastModalChildOf(dlg);
            }
        }
    }

    // this is the last window
    return parent;
}