public static void localiseButton ( AbstractButton button , String key , String defaultString , boolean setMnemonic ) { AnnotatedString as = new AnnotatedString ( L10N . getLocalString ( key , defaultString ) ) ; button . setText ( as . toString ( ) ) ; int mnemonic ; if ( setMnemonic && ( mnemonic = as . getMnemonic ( ) ) != KeyEvent . VK_UNDEFINED ) { button . setMnemonic ( mnemonic ) ; button . setDisplayedMnemonicIndex ( as . getMnemonicIndex ( ) ) ; } }
Localise the given AbstractButton setting the text and optionally mnemonic Note that AbstractButton includes menus and menu items .