private void loadButtonText(AbstractButton component,String text){
  StringBuffer result=new StringBuffer();
  boolean haveMnemonic=false;
  char mnemonic='\0';
  int mnemonicIndex=-1;
  for (int i=0; i < text.length(); i++) {
    if (text.charAt(i) == '&') {
      i++;
      if (i == text.length()) {
        break;
      }
      if (!haveMnemonic && text.charAt(i) != '&') {
        haveMnemonic=true;
        mnemonic=text.charAt(i);
        mnemonicIndex=result.length();
      }
    }
    result.append(text.charAt(i));
  }
  component.setText(result.toString());
  if (haveMnemonic) {
    component.setMnemonic(mnemonic);
    component.setDisplayedMnemonicIndex(mnemonicIndex);
  }
}

private void loadButtonText ( AbstractButton component , String text ) { StringBuffer result = new StringBuffer ( ) ; boolean haveMnemonic = false ; char mnemonic = '\0' ; int mnemonicIndex = - 1 ; for ( int i = 0 ; i < text . length ( ) ; i ++ ) { if ( text . charAt ( i ) == '&' ) { i ++ ; if ( i == text . length ( ) ) { break ; } if ( ! haveMnemonic && text . charAt ( i ) != '&' ) { haveMnemonic = true ; mnemonic = text . charAt ( i ) ; mnemonicIndex = result . length ( ) ; } } result . append ( text . charAt ( i ) ) ; } component . setText ( result . toString ( ) ) ; if ( haveMnemonic ) { component . setMnemonic ( mnemonic ) ; component . setDisplayedMnemonicIndex ( mnemonicIndex ) ; } }
initially generated by intellij from a . form file and checked in .
