/** * Set key stroke to use as keyboard accelerator from a string in a format * compatible with {@code KeyStroke#getKeyStroke(String)}. If {@code null} * or an incorrectly formatted string is specified, any existing value is * lost (removed). * * @param key String representation of key stroke. * * @see #ACCELERATOR_KEY * @see KeyStroke * @see KeyStroke#getKeyStroke(String) */ public void setAcceleratorKey( final String key ) { if ( key != null ) { final KeyStroke keyStroke = KeyStroke.getKeyStroke( key ); if ( keyStroke == null ) { throw new IllegalArgumentException( "Invalid accelerator for " + getName() + ": " + key ); } setAcceleratorKey( keyStroke ); } }
setDefaultIcon(); setShortDescription( ResourceBundleTools.getString( bundle, key + "Tip", null ) ); setAcceleratorKey( ResourceBundleTools.getString( bundle, key + "KeyStroke", null ) ); setMnemonicKey( ResourceBundleTools.getString( bundle, key + "Mnemonic", null ) );