Bernard
Bernard

Reputation: 4580

Combo box guess and search from user input?

I have a combobox with more than 10000 elements. I'm looking for a way when user open combobox and type for instance 'a' it brings all the element start with 'a' and when user type 'ai' it brings up all the elements start with 'ai' I don't know what they call it but please let me know if there is pre-written library or example?

Upvotes: 0

Views: 190

Answers (1)

nachokk
nachokk

Reputation: 14413

Yes you can take a look to swingx that have JComboBox with autocomplete feature, specially AutoCompleteDecorator

Example:

this.comboBox = new JComboBox(new Object[] { "Ester", "Jordi",
        "Jordina", "Jorge", "Sergi" });
AutoCompleteDecorator.decorate(this.comboBox);

Upvotes: 1

Related Questions