public void menuKeyPressed(MenuKeyEvent e) { if (e.getKeyCode() == mnemonic) { ActionEvent ae = new ActionEvent( e.getSource(), e.getID(), (String) getValue(Action.NAME), e.getModifiers()); actionPerformed(ae); e.consume(); } }
/** * Handles a keystroke in a menu. * * @param e a <code>MenuKeyEvent</code> object * @since 1.5 */ private void processMenuKeyEvent(MenuKeyEvent e) { switch (e.getID()) { case KeyEvent.KEY_PRESSED: fireMenuKeyPressed(e); break; case KeyEvent.KEY_RELEASED: fireMenuKeyReleased(e); break; case KeyEvent.KEY_TYPED: fireMenuKeyTyped(e); break; default: break; } }