/** * Set mnemonic key from a string in a format compatible with {@code * KeyStroke#getKeyStroke(String)}. Any specified modifiers will be ignored. * If {@code null} or an incorrectly formatted string is specified, any * existing value is lost (removed). * * @param key String representation of mnemonic key. * * @see #MNEMONIC_KEY * @see KeyEvent * @see JMenuItem#setAction(Action) * @see KeyStroke#getKeyStroke(String) */ public void setMnemonicKey( final String key ) { final KeyStroke keyStroke = KeyStroke.getKeyStroke( key ); setMnemonicKey( ( keyStroke == null ) ? -1 : keyStroke.getKeyCode() ); }
setShortDescription( ResourceBundleTools.getString( bundle, key + "Tip", null ) ); setAcceleratorKey( ResourceBundleTools.getString( bundle, key + "KeyStroke", null ) ); setMnemonicKey( ResourceBundleTools.getString( bundle, key + "Mnemonic", null ) );