greatmajestics
greatmajestics

Reputation: 1093

JCombo Box Searching

Recently i m working on a s/w project which require an editable combo box... At start i attached action Listener whith it but it didnt worked... Then i started searching over document listener which seems to be suitable for this situation

I want to create this

-------------------------
a                              //---------- Consider this as a combo box
-------------------------
a  
ab
aba
abca
abdaa          

---------------------
ab                              //---------- Consider this as a combo box
---------------------
ab
aba
abca
abdaa             //- Hints

Now i am bit confused how to use document listener with combo box , because every where JTextComponent is attached with it.... Please help.

Upvotes: 3

Views: 778

Answers (2)

greatmajestics
greatmajestics

Reputation: 1093

Found a perfect example that is very fast: AutoCompletion.

Upvotes: 0

Dan W
Dan W

Reputation: 5782

Here's an implementation of what you're looking for: Searchable JComboBox

Upvotes: 1

Related Questions