diff options
author | Audrius Meskauskas <audriusa@bluewin.ch> | 2005-04-19 07:23:13 +0200 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2005-04-19 05:23:13 +0000 |
commit | a7661a40879050ef23073fc92311968538546e91 (patch) | |
tree | e6cfd5d4a4438d2fb3249c8dd9432be0f9b648e1 | |
parent | 747a54e2e6fe4ac316d2eef74c48448d862cf9f5 (diff) | |
download | gcc-a7661a40879050ef23073fc92311968538546e91.zip gcc-a7661a40879050ef23073fc92311968538546e91.tar.gz gcc-a7661a40879050ef23073fc92311968538546e91.tar.bz2 |
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
-rw-r--r-- | libjava/ChangeLog | 6 | ||||
-rw-r--r-- | libjava/javax/swing/JComboBox.java | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 2f889b3d..cb22bfe 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -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 diff --git a/libjava/javax/swing/JComboBox.java b/libjava/javax/swing/JComboBox.java index 4e2a881..078c77d 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); } /** |