I commited this patch which makes sure that after a change in the
selection model via the mouse or keyboard, we make sure that the new
lead selection index is visible.

Note: you can only see this work after JViewport.scrollRectToVisible()
is implemented (I submitted this patch for approval earlier today).

Patch is attached.


2005-07-27  Anthony Balkissoon  <[EMAIL PROTECTED]>

* javax/swing/plaf/basic/BasicListUI.java:
(KeyHandler.keyPressed): Ensure the new lead selection index is visible
after making a change.
(MouseInputHandler.mouseClicked): Likewise.

- Tony
Index: javax/swing/plaf/basic/BasicListUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicListUI.java,v
retrieving revision 1.27
diff -u -r1.27 BasicListUI.java
--- javax/swing/plaf/basic/BasicListUI.java	22 Jul 2005 17:40:13 -0000	1.27
+++ javax/swing/plaf/basic/BasicListUI.java	27 Jul 2005 19:45:50 -0000
@@ -276,7 +276,9 @@
           BasicListUI.this.list.getSelectionModel().
             setLeadSelectionIndex(Math.min(lead+1,max));
         }
-      
+
+      BasicListUI.this.list.ensureIndexIsVisible
+        (BasicListUI.this.list.getLeadSelectionIndex());
     }
   }
   
@@ -334,6 +336,9 @@
         }
       else
         BasicListUI.this.list.setSelectedIndex(index);
+      
+      BasicListUI.this.list.ensureIndexIsVisible
+        (BasicListUI.this.list.getLeadSelectionIndex());
     }
 
     /**
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to