2005-04-19 Audrius Meskauskas <audriusa@bluewin.ch>
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Apr 2005 05:23:13 +0000 (05:23 +0000)
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Apr 2005 05:23:13 +0000 (05:23 +0000)
* javax/swing/JComboBox.java (constructors): selecting the
first item if the box was constructed from the provided
non - empty array or vector.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98376 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/javax/swing/JComboBox.java

index 2f889b3..cb22bfe 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2005-04-19  Michael Koch  <konqueror@gmx.de>
 
        * gnu/java/awt/peer/gtk/GdkGraphics.java
index 4e2a881..078c77d 100644 (file)
@@ -185,6 +185,9 @@ public class JComboBox extends JComponent implements ItemSelectable,
   public JComboBox(Object[] itemArray)
   {
     this(new DefaultComboBoxModel(itemArray));
+    
+    if (itemArray.length > 0) 
+      setSelectedIndex(0);
   }
 
   /**
@@ -195,6 +198,9 @@ public class JComboBox extends JComponent implements ItemSelectable,
   public JComboBox(Vector itemVector)
   {
     this(new DefaultComboBoxModel(itemVector));
+
+    if (itemVector.size() > 0)
+      setSelectedIndex(0);
   }
 
   /**