!ks.isOnKeyRelease()); boolean result = super.processKeyBinding (newStroke, newEvent, condition, pressed); return super.processKeyBinding (ks, e, condition, pressed); } else { return false; return super.processKeyBinding (ks, e, condition, pressed);
/** Overrides superclass method. * If it has accelerator delegates processing of it to the first item. */ protected boolean processKeyBinding( KeyStroke ks, KeyEvent e, int condition, boolean pressed) { // If it is as accelerator process the doClick binding to the // first sub-item. if(ks.equals(accelerator)) { // Use first item if there is one. Component[] cs = getMenuComponents(); if(cs.length > 0 && cs[0] instanceof JComponent) { JComponent comp = (JComponent)cs[0]; ActionMap am = comp.getActionMap(); if(am != null && comp.isEnabled()) { Action action = am.get("doClick"); // NOI18N if (action != null) { return SwingUtilities.notifyAction( action, ks, e, comp, e.getModifiers()); } } return false; } } return super.processKeyBinding(ks, e, condition, pressed); }
/** Overrides superclass method. * If it has accelerator delegates processing of it to the first item. */ protected boolean processKeyBinding( KeyStroke ks, KeyEvent e, int condition, boolean pressed) { // If it is as accelerator process the doClick binding to the // first sub-item. if(ks.equals(accelerator)) { // Use first item if there is one. Component[] cs = getMenuComponents(); if(cs.length > 0 && cs[0] instanceof JComponent) { JComponent comp = (JComponent)cs[0]; ActionMap am = comp.getActionMap(); if(am != null && comp.isEnabled()) { Action action = am.get("doClick"); // NOI18N if (action != null) { return SwingUtilities.notifyAction( action, ks, e, comp, e.getModifiers()); } } return false; } } return super.processKeyBinding(ks, e, condition, pressed); }