[Patch] javax.swing.JComboBox

Michael Koch konqueror@gmx.de
Tue Apr 19 05:25:00 GMT 2005


Hi list,


I just merged the attached patch from GNU classpath to HEAD.


Michael


2005-04-19  Audrius Meskauskas  <audriusa@bluewin.ch>

	* javax/swing/JComboBox.java (constructors): selecting the
	first item if the box was constructed from the provided
	non - empty array or vector.

-------------- next part --------------
Index: javax/swing/JComboBox.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JComboBox.java,v
retrieving revision 1.10
diff -u -r1.10 JComboBox.java
--- javax/swing/JComboBox.java	16 Feb 2005 20:02:24 -0000	1.10
+++ javax/swing/JComboBox.java	19 Apr 2005 05:22:52 -0000
@@ -185,6 +185,9 @@
   public JComboBox(Object[] itemArray)
   {
     this(new DefaultComboBoxModel(itemArray));
+    
+    if (itemArray.length > 0) 
+      setSelectedIndex(0);
   }
 
   /**
@@ -195,6 +198,9 @@
   public JComboBox(Vector itemVector)
   {
     this(new DefaultComboBoxModel(itemVector));
+
+    if (itemVector.size() > 0)
+      setSelectedIndex(0);
   }
 
   /**


More information about the Java-patches mailing list