tags:

views:

39

answers:

1

I am creating a search list in java. If I enter the beginning letters, then the corresponding words which belongs to the letters will be display on the Jlist.For that is there any build in methods is there? Then how can i search the words with starting characters? Suggest me. Thank in advance..

+1  A: 

SwingX has some nice features, including autocomplete. You can get it here

This is how you can use it:

JTextField textField = new JTextField();
textField.setText("Remi");

Vector v = new Vector();
v.add("Jimmy");
v.add("Julie");
v.add("Julien");
v.add("Juliette");

JList list = new JList(v);
Configurator.enableAutoCompletion(list, textField);
Guillaume