Index: javax/swing/JLabel.java =================================================================== RCS file: /cvs/gcc/gcc/libjava/javax/swing/JLabel.java,v retrieving revision 1.4.2.10 diff -u -r1.4.2.10 JLabel.java --- javax/swing/JLabel.java 6 Dec 2004 16:58:03 -0000 1.4.2.10 +++ javax/swing/JLabel.java 22 Dec 2004 21:34:02 -0000 @@ -372,7 +372,7 @@ displayedMnemonic = mnemonic; if (text != null) - setDisplayedMnemonicIndex(text.indexOf(mnemonic)); + setDisplayedMnemonicIndex(text.toUpperCase().indexOf(mnemonic)); } } @@ -385,7 +385,7 @@ */ public void setDisplayedMnemonic(char mnemonic) { - setDisplayedMnemonic((int) mnemonic); + setDisplayedMnemonic((int) Character.toUpperCase(mnemonic)); } /** @@ -399,7 +399,7 @@ } /** - * This method sets which character in the text will be the underlined + * This method sets which character in the text will be the underlined * character. If the given index is -1, then this indicates that there is * no mnemonic. If the index is less than -1 or if the index is equal to * the length, this method will throw an IllegalArgumentException. @@ -410,19 +410,22 @@ * length. */ public void setDisplayedMnemonicIndex(int newIndex) - throws IllegalArgumentException + throws IllegalArgumentException { if (newIndex < -1 || (text != null && newIndex >= text.length())) throw new IllegalArgumentException(); - if (text == null || text.charAt(newIndex) != displayedMnemonic) + if (newIndex == -1 + || text == null + || text.charAt(newIndex) != displayedMnemonic) newIndex = -1; if (newIndex != displayedMnemonicIndex) { - firePropertyChange(DISPLAYED_MNEMONIC_INDEX_CHANGED_PROPERTY, - displayedMnemonicIndex, newIndex); + int oldIndex = displayedMnemonicIndex; displayedMnemonicIndex = newIndex; + firePropertyChange(DISPLAYED_MNEMONIC_INDEX_CHANGED_PROPERTY, + oldIndex, newIndex); } }