Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JComboBox not allowing selection from dropdown list

 
Farrukh Najmi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
complex.

Thanks for any help.
 
Farrukh Najmi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SOLVED

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.

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic