J
Jacques Chaurette
Hi, this has probably been asked before but I can't find any reference to
it. In this sample of code I am trying to set the index of a combo box from
an action_event triggered in another combo box.
I am having problems using the selectedIndex() method, sometimes it does not
work like in this code:
void jComboBoxFitSel_itemStateChanged(ItemEvent e) {
if (jComboBoxFitSel.getSelectedIndex() == 4)
{
jLabel6.setText("pass 4");
jComboDia.removeAllItems();
jComboDia.insertItemAt("2.0",0);
....
jComboDia.setSelectedIndex(0);
}
else
{
jLabel6.setText("pass not 4");
jComboDia.removeAllItems();
...
jComboDia.setSelectedIndex(3);
}
}
}
when either one of these conditons are filled the jComboDia.setSelectedIndex
command does not execute, is there some problem with trying to set an index
in a combo box from another combo box.
Cheers, thanks for any help.
Jack
it. In this sample of code I am trying to set the index of a combo box from
an action_event triggered in another combo box.
I am having problems using the selectedIndex() method, sometimes it does not
work like in this code:
void jComboBoxFitSel_itemStateChanged(ItemEvent e) {
if (jComboBoxFitSel.getSelectedIndex() == 4)
{
jLabel6.setText("pass 4");
jComboDia.removeAllItems();
jComboDia.insertItemAt("2.0",0);
....
jComboDia.setSelectedIndex(0);
}
else
{
jLabel6.setText("pass not 4");
jComboDia.removeAllItems();
...
jComboDia.setSelectedIndex(3);
}
}
}
when either one of these conditons are filled the jComboDia.setSelectedIndex
command does not execute, is there some problem with trying to set an index
in a combo box from another combo box.
Cheers, thanks for any help.
Jack