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());
        }
    }
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.

@param button
The button to localise
@param key
The key to look up in resource bundle
@param defaultString
default String to use if key not found
@param setMnemonic
whether or not to set the mnemonic. According to Sun's
guidelines, default/cancel buttons should not have mnemonics
but instead should use Return/Escape