Forums Register Login

Textfield/Combobox with auto complete feature!

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
this would have to be the #2 swing FAQ (behind background image).

try google - there are countless examples
+Pie Number of slices to send: Send
Check this out.
+Pie Number of slices to send: Send
Hi Maneesh,

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

Regards
Ashwin
I was her plaything! And so was this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 10300 times.
Similar Threads
Textfield with autoscroll feature!
JPopUPmenu Problem of PopUp scroll
JTable and JCombox as the cell editor
select item from editable combobox
Non Editable JComboBox background color
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 23:10:03.