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
This commit is contained in:
Audrius Meskauskas 2005-04-19 07:23:13 +02:00 committed by Michael Koch
parent 747a54e2e6
commit a7661a4087
2 changed files with 12 additions and 0 deletions

View 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

View 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);
}
/**