The keyboard focus must be explicitly requested now for Swing components. Done here for JList.

2006-08-05  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/plaf/basic/BasicListUI.java
        (MouseInputHandler.mousePressed): Request focus on list
        component.

/Roman
Index: javax/swing/plaf/basic/BasicListUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicListUI.java,v
retrieving revision 1.60
diff -u -1 -2 -r1.60 BasicListUI.java
--- javax/swing/plaf/basic/BasicListUI.java	2 Aug 2006 21:46:16 -0000	1.60
+++ javax/swing/plaf/basic/BasicListUI.java	8 Aug 2006 12:14:15 -0000
@@ -470,25 +470,26 @@
       
       list.ensureIndexIsVisible(list.getLeadSelectionIndex());
     }
 
     /**
      * Called when a mouse button is pressed down on the
      * [EMAIL PROTECTED] JList}.
      *
      * @param event The event representing the mouse press
      */
     public void mousePressed(MouseEvent event)
     {
-      // TODO: What should be done here, if anything?
+      // We need to explicitly request focus.
+      list.requestFocusInWindow();
     }
 
     /**
      * Called when a mouse button is released on
      * the [EMAIL PROTECTED] JList}
      *
      * @param event The event representing the mouse press
      */
     public void mouseReleased(MouseEvent event)
     {
       // TODO: What should be done here, if anything?
     }

Reply via email to