cks
cks

Reputation: 83

Automatic suggestion for JTextField

My Java application gives user a textbox to input some String data.Domain size of input is around 500 words. I want to give suggestion when user starts typing a word. Something Like Google Automatic suggestion. Any idea how to do that?

Upvotes: 0

Views: 3561

Answers (1)

Moh-Aw
Moh-Aw

Reputation: 3018

Here is an example of how to do it:

http://www.java2s.com/Code/Java/Swing-JFC/AutocompleteTextField.htm

When you create an instance of this autocomplete textfield you have to pass your 500 words in there as a list.

Upvotes: 1

Related Questions