I have a non-editable JComboBox with some pre-configured choices via a model.
The choices display fine in dropdown menu when I click on the JComboBox.
As I move cursor over the choices they get highlighted. However, when I click on a
choice they do not get selected and instead I see the default item stay in the combobox.
What could be the reason why I cannot select from drop down list in my JComboBox?
Note that I am not including any code as my JComboBoxsub-class and its model are fairly
Thanks for any help.
Joined: Jan 29, 2008
I determined the cause of the problem. In my JComboBox sub-class I was incorrectly overriding the setSelectedItem(Object) method and not calling super.setSelectedItem(Object) when I should have been.
subject: JComboBox not allowing selection from dropdown list