List of usage examples for java.awt EventQueue push
public void push(EventQueue newEventQueue)
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()); }