]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
JComboBox.java (constructors): selecting the first item if the box was constructed...
authorAudrius Meskauskas <audriusa@bluewin.ch>
Tue, 19 Apr 2005 05:23:13 +0000 (07:23 +0200)
committerMichael Koch <mkoch@gcc.gnu.org>
Tue, 19 Apr 2005 05:23:13 +0000 (05:23 +0000)
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.

From-SVN: r98376

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

index 2f889b3df929a5347cf2612ad9b4fe2eb5397bbc..cb22bfee058394834b7f323838743493c607c880 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 4e2a88110fc201986aee9eb09cc2701b4fa214dd..078c77df436acad266dd618ca76a9e25024755cd 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);
   }
 
   /**