Example usage for java.awt EventQueue push

List of usage examples for java.awt EventQueue push

Introduction

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

Prototype

public void push(EventQueue newEventQueue) 

Source Link

Document

Replaces the existing EventQueue with the specified one.

Usage

From source file:ru.goodfil.catalog.ui.forms.FiltersPanel.java

private void globalHotkeys() {
    class FiltersPanelGlobalHotkey extends EventQueue {
        protected void dispatchEvent(AWTEvent event) {
            if (event instanceof KeyEvent) {
                KeyEvent keyEvent = (KeyEvent) event;
                if (keyEvent.getKeyCode() == KeyEvent.VK_F1 && keyEvent.getID() == KeyEvent.KEY_PRESSED) {
                } else {
                    super.dispatchEvent(event);
                }// www  .j a v  a  2 s  . c  om
            } else {
                super.dispatchEvent(event);
            }
        }
    }

    EventQueue ev = Toolkit.getDefaultToolkit().getSystemEventQueue();
    ev.push(new FiltersPanelGlobalHotkey());
}