This week's book giveaway is in the Artificial Intelligence forum.
We're giving away four copies of Pragmatic AI and have Noah Gift on-line!
See this thread for details.
Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

JComboBox problem  RSS feed

 
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...
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!