• Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing JTable with searchable combo box

 
RobertWayne Thompson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone tell me how to make a combo box in a JTable searchable, or at least give it some keyboard functionality?
I have a table that has a column with time zones.
Since there are hundreds of entries I want to make it selectable, but also editable so the user can type a value.
I'm using code similar to the code below.
My problem is the default behavior has no keyboard functionality, and when I open the list it always opens to the first value.
Is there a way to make it search the list for typed values and open the drop-down list when it finds one?
Is there a way to at least open the drop-down list when the user types alt-<down arrow>?
I've gone round and round with this.
Every piece of code I see online has 100s of lines of complex code, multiple listeners, etc.
There has to be a SIMPLE way to do this.



 
Tai Yo
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you may search for Autocomplete jcb, here you can find some solutions:
AutoComplete JComboBox
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!