Hi,

I fixed the BasicComboBoxUI so that the box is closed when the ComboBox
(or its list) loses the focus.

2005-10-10  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/plaf/basic/BasicComboBoxUI.java
        (installListeners): Also install focusListener on the listBox.
        (uninstallListeners): Also uninstall focusListener from the
listBox.
        (setPopupVisible): Request focus on the listbox when making the
        popup visible.

/Roman
Index: javax/swing/plaf/basic/BasicComboBoxUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicComboBoxUI.java,v
retrieving revision 1.27
diff -u -r1.27 BasicComboBoxUI.java
--- javax/swing/plaf/basic/BasicComboBoxUI.java	7 Nov 2005 16:59:06 -0000	1.27
+++ javax/swing/plaf/basic/BasicComboBoxUI.java	10 Nov 2005 15:56:28 -0000
@@ -286,6 +286,7 @@
 
     focusListener = createFocusListener();
     comboBox.addFocusListener(focusListener);
+    listBox.addFocusListener(focusListener);
 
     itemListener = createItemListener();
     comboBox.addItemListener(itemListener);
@@ -335,6 +336,7 @@
     propertyChangeListener = null;
 
     comboBox.removeFocusListener(focusListener);
+    listBox.removeFocusListener(focusListener);
     focusListener = null;
 
     comboBox.removeItemListener(itemListener);
@@ -613,7 +615,10 @@
   public void setPopupVisible(JComboBox c, boolean v)
   {
     if (v)
-      popup.show();
+      {
+        popup.show();
+        popup.getList().requestFocus();
+      }
     else
       popup.hide();
   }
_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to