CVSROOT: /sources/classpath Module name: classpath Changes by: David Gilbert <trebligd> 06/06/22 09:47:33
Modified files: . : ChangeLog javax/swing : JLabel.java Log message: 2006-06-22 David Gilbert <[EMAIL PROTECTED]> * javax/swing/JLabel.java (setDisplayedMnemonic(int)): Fire property change event AFTER updating field, (setDisplayedMnemonicIndex): Modified argument checking to handle case where label text is null. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.7907&r2=1.7908 http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/JLabel.java?cvsroot=classpath&r1=1.37&r2=1.38 Patches: Index: ChangeLog =================================================================== RCS file: /sources/classpath/classpath/ChangeLog,v retrieving revision 1.7907 retrieving revision 1.7908 diff -u -b -r1.7907 -r1.7908 --- ChangeLog 22 Jun 2006 09:04:14 -0000 1.7907 +++ ChangeLog 22 Jun 2006 09:47:31 -0000 1.7908 @@ -1,6 +1,14 @@ 2006-06-22 David Gilbert <[EMAIL PROTECTED]> * javax/swing/JLabel.java + (setDisplayedMnemonic(int)): Fire property change event AFTER updating + field, + (setDisplayedMnemonicIndex): Modified argument checking to handle case + where label text is null. + +2006-06-22 David Gilbert <[EMAIL PROTECTED]> + + * javax/swing/JLabel.java (setDisplayedMnemonic): Updated API docs, (getDisplayedMnemonic): Removed unnecessary type-cast, (setDisplayedMnemonicIndex): Removed unnecessary validation, Index: javax/swing/JLabel.java =================================================================== RCS file: /sources/classpath/classpath/javax/swing/JLabel.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -b -r1.37 -r1.38 --- javax/swing/JLabel.java 22 Jun 2006 09:04:15 -0000 1.37 +++ javax/swing/JLabel.java 22 Jun 2006 09:47:32 -0000 1.38 @@ -622,9 +622,9 @@ { if (displayedMnemonic != mnemonic) { - firePropertyChange("displayedMnemonic", displayedMnemonic, mnemonic); + int old = displayedMnemonic; displayedMnemonic = mnemonic; - + firePropertyChange("displayedMnemonic", old, displayedMnemonic); if (text != null) setDisplayedMnemonicIndex(text.toUpperCase().indexOf(mnemonic)); } @@ -677,7 +677,10 @@ public void setDisplayedMnemonicIndex(int newIndex) throws IllegalArgumentException { - if (newIndex < -1 || (text != null && newIndex >= text.length())) + int maxValid = -1; + if (text != null) + maxValid = text.length() - 1; + if (newIndex < -1 || newIndex > maxValid) throw new IllegalArgumentException(); if (newIndex != displayedMnemonicIndex)