Help: JComboBoxes and Case statements
Posted on 2003-02-25
I was wondering if anyone could give me any help with this.I have a JComboBox with say 7 items. These are all added to the JComboBox and the ComboBox also has an itemlistener. I then have an itemstatechanged method and i get the instance of the JComboBox using
if(ie.getSource() instanceof JComboBox)
//userChoice = track.getSelectedItem();
Say, the items in the JComboBox are called ab, cd, ef, gh, ij, kl and mn. I want to have a case statement so if ab is selected i go off and do something else like work out some calculation. Is this possible?
Thanks for your time