• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Textfield/Combobox with auto complete feature!

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In our project we need a feature of combobox with auto complete feature. It is similar to the auto complete feature provided by google's home page textfield.

If I type "a" in the textfield on the google's home page, it shows all the words typed in the past starting with "a".

On the similar lines I need to provide a textfield/ combobox. When user types any letter, then the data starting with this letter, should appear as drop down below textfield. Once user selects one item from the list, it should appear in the textfield.

I tried implementing it using JCombobox (by making it editable) and implementing the keyListener interface. But somehow the keyPressed, keyTyped and the keyReleased methods are not triggered for editable JCombobox.

Kindly let me know if someone has built up some custom component like this before.

Regards
Ashwin
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this would have to be the #2 swing FAQ (behind background image).

try google - there are countless examples
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check this out.
 
Ash Kondhalkar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Maneesh,

Thank you very much for this link. This helped me and my problem is solved. Thanks again!

Regards
Ashwin
 
reply
    Bookmark Topic Watch Topic
  • New Topic