• Post Reply Bookmark Topic Watch Topic
  • New Topic

JComboBox problem

 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was asked to look at the problem with searchable JCombBox. Basically it defines combo box to be editable and searches for input string from combo box's data. Here is the code:


and SearchComboBox.java


Now, this works fine as is. If I define eSearchComboBox everything works perfect. But if I do:

When I select item from eSearchComboBox it does not show up in eSearchComboBox's selection area.
Does anyone have any idea why code would break if I define combo box to editable? There are no exception thrown when I select an item.

thanks,
Alex

P.S. I've changed the code around and use ComboBoxModel to deal with data and it works, but I am just curious why setEditable(false) does not work?
[ April 06, 2005: Message edited by: Alex Kravets ]
 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, it's funny how sometimes telling your problem makes you think more about it. I think the problem is in comparison:

since nothing was typed, there is nothing to compare to...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!