summaryrefslogtreecommitdiff
path: root/libjava/javax
diff options
context:
space:
mode:
authorAudrius Meskauskas <audriusa@bluewin.ch>2005-04-19 07:23:13 +0200
committerMichael Koch <mkoch@gcc.gnu.org>2005-04-19 05:23:13 +0000
commita7661a40879050ef23073fc92311968538546e91 (patch)
treee6cfd5d4a4438d2fb3249c8dd9432be0f9b648e1 /libjava/javax
parent747a54e2e6fe4ac316d2eef74c48448d862cf9f5 (diff)
downloadgcc-a7661a40879050ef23073fc92311968538546e91.tar.gz
JComboBox.java (constructors): selecting the first item if the box was constructed from the provided non -...
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
Diffstat (limited to 'libjava/javax')
-rw-r--r--libjava/javax/swing/JComboBox.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/libjava/javax/swing/JComboBox.java b/libjava/javax/swing/JComboBox.java
index 4e2a88110fc..078c77df436 100644
--- a/libjava/javax/swing/JComboBox.java
+++ b/libjava/javax/swing/JComboBox.java
@@ -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);
}
/**