Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Textfield/Combobox with auto complete feature!  RSS feed

 
Ash Kondhalkar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • 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
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this would have to be the #2 swing FAQ (behind background image).

try google - there are countless examples
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
Ash Kondhalkar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!