How to implement the 'auto complete' feature in a JFormattedTextField?

4

I need when I type in JFormattedTextField to appear text suggestions. Is it possible to do this?

    
asked by anonymous 14.05.2015 / 14:29

1 answer

1

Hello, use SwingX which has a class called AutoCompleteDecorator

JComboBox comboBox = [...];
AutoCompleteDecorator.decorate(comboBox);
List items = [...];

JTextField textField = [...];
AutoCompleteDecorator.decorate(textField, items);

JList list = [...];
JTextField textField = [...];
AutoCompleteDecorator.decorate(list, textField);
    
27.05.2015 / 18:21