if(type.equals(oldType)) {
((JComboBox) myComponent).setSelectedIndex(i);
return;
}
}
<BUG>}
((JComboBox) myComponent).setSelectedIndex(0);
}</BUG>
public void addItemListener(ItemListener aListener) {
if(myComponent instanceof JComboBox) {

if(type.equals(oldType)) {
((JComboBox) myComponent).setSelectedIndex(i);
return;
}
}
}
if (types.length > 0) {
((JComboBox) myComponent).setSelectedIndex(0);
}
}
public void addItemListener(ItemListener aListener) {
if(myComponent instanceof JComboBox) {
