3

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.

MByD
  • 135,866
  • 28
  • 264
  • 277
greatmajestics
  • 1,083
  • 4
  • 19
  • 41
  • See also this [answer](http://stackoverflow.com/questions/6478577/how-to-make-a-text-field-for-searchingwith-tips-like-a-google-search/6479302#6479302). – trashgod Aug 24 '11 at 21:37

2 Answers2

1

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

Dan W
  • 5,718
  • 4
  • 33
  • 44
  • To the point approach, but please give this a try... It work but create a lot problem..... During writing word disappear... Also refresh rate is quit visible, Searching is not strict.... – greatmajestics Aug 26 '11 at 15:08
0

Found a perfect example that is very fast: AutoCompletion.

Ryan Wersal
  • 3,210
  • 1
  • 20
  • 29
greatmajestics
  • 1,083
  • 4
  • 19
  • 41