This patch (committed) fixes a bug in the getMinSelectionIndex() method:

2006-04-28  David Gilbert  <[EMAIL PROTECTED]>

        * javax/swing/JList.java
        (getMinSelectionIndex): Return correct value, added API docs,
        (getMaxSelectionIndex): Added API docs.

Regards,

Dave
Index: javax/swing/JList.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/JList.java,v
retrieving revision 1.51
diff -u -r1.51 JList.java
--- javax/swing/JList.java      28 Apr 2006 14:35:21 -0000      1.51
+++ javax/swing/JList.java      28 Apr 2006 14:45:27 -0000
@@ -2048,11 +2048,27 @@
     return selectionModel.getLeadSelectionIndex();
   }
 
+  /**
+   * Returns the lowest item index in the current selection, or <code>-1</code>
+   * if there is no selection.
+   * 
+   * @return The index.
+   * 
+   * @see #getMaxSelectionIndex()
+   */
   public int getMinSelectionIndex()
   {
-    return selectionModel.getMaxSelectionIndex();
+    return selectionModel.getMinSelectionIndex();
   }
 
+  /**
+   * Returns the highest item index in the current selection, or 
+   * <code>-1</code> if there is no selection.
+   * 
+   * @return The index.
+   * 
+   * @see #getMinSelectionIndex()
+   */
   public int getMaxSelectionIndex()
   {
     return selectionModel.getMaxSelectionIndex();

Reply via email to