Example usage for java.awt Toolkit removeAWTEventListener

List of usage examples for java.awt Toolkit removeAWTEventListener

Introduction

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

Prototype

public void removeAWTEventListener(AWTEventListener listener) 

Source Link

Document

Removes an AWTEventListener from receiving dispatched AWTEvents.

Usage

From source file:net.sourceforge.squirrel_sql.fw.gui.debug.DebugEventListener.java

public void setEnabled(boolean enable) {
    Toolkit kit = Toolkit.getDefaultToolkit();
    if (enable) {
        /* register as a listener for mouse events */
        kit.addAWTEventListener(this, AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);

        /* show all tooltips for ten seconds before hiding */
        ToolTipManager.sharedInstance().setDismissDelay(10000);
    } else {/*  w w  w. ja  v a2s  .c o  m*/
        kit.removeAWTEventListener(this);
    }
}