Win a copy of Rust Web Development this week in the Other Languages 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Swing JTable with searchable combo box

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.



 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you may search for Autocomplete jcb, here you can find some solutions:
AutoComplete JComboBox
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic