Example usage for java.awt Component removeNotify

List of usage examples for java.awt Component removeNotify

Introduction

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

Prototype

public void removeNotify() 

Source Link

Document

Makes this Component undisplayable by destroying it native screen resource.

Usage

From source file:org.eclipse.wb.internal.swing.utils.SwingImageUtils.java

/**
 * Set "visible" property of {@link Component} using dispatch thread.
 * /* ww  w . ja  v  a  2 s  .  c  om*/
 * @param component
 *          A {@link Component} which property would be set.
 * @param visible
 *          A "visible" property value to set.
 */
static void setVisible(final Component component, final boolean visible) throws Exception {
    // set "visible" property in AWT Queue
    SwingUtils.runLaterAndWait(new RunnableEx() {
        public void run() throws Exception {
            component.setVisible(visible);
            if (!visible) {
                if (EnvironmentUtils.IS_LINUX) {
                    component.removeNotify();
                }
            }
        }
    });
}