Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JComboBox ActionListener not reacting  RSS feed

 
Sebastiaan Kortleven
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I have a JComboBox and I fill it with a custom-made object (String name, Long rowid). The JComboBox nicely shows the value returned by my toString method, but when I change the selection, no action event is thrown..
If I fill the jcombobox with simple Strings, all works well...
Is there another method I need? Or do I need to write my own listcellrenderer?
 
Sebastiaan Kortleven
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My equals method was incorrect.. it returned true too easy.. so the different items in the JComboBox are not recognized as different items
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!