combo box selection problem

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top