简体   繁体   中英

Autocomplete and editable JTextField using AutoCompleteDecorator

I am using a JTextField for auto suggestion, as described in following code

String[] myStrings = new String[] {"Elem1","Elem2","Elem3","Elem4","Elem5"};

JList list = new JList(myStrings); //data has type Object[]
AutoCompleteDecorator.decorate(list, this.customerNameField, ObjectToStringConverter.DEFAULT_IMPLEMENTATION);

Now I can only select the name from myStrings , but my client want that he can select the value from auto suggestion also he can add other vales but above code is not allowing me to do this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM