Example usage for javax.swing JFrame isDisplayable

List of usage examples for javax.swing JFrame isDisplayable

Introduction

In this page you can find the example usage for javax.swing JFrame isDisplayable.

Prototype

public boolean isDisplayable() 

Source Link

Document

Determines whether this component is displayable.

Usage

From source file:Main.java

/**
 * Schedule disposal of a frame (async).
 *//*from  w  ww.  j av  a  2 s .c  o m*/
public static void dispose(final JFrame frame) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            if (frame.isDisplayable())
                frame.dispose();
        }
    });
}