This is a sweet litle problem that i saw in a Developer 2.0 issue.
What you need to do is:
1) set up a sorted ComboBoxModel so that all items entered are alphabetically ordered for ease in indexing
pattern matches
2) set up a document listener for the JTextField that forms the Editor component
3) listen for the updates and search for the pattern in the JTextField and fill the matching item into the field. make sure you 'select' the autocompleted text, i.e., the part of the item that you inserted after the pattern typed in, so that the next character typed in by the user as a rejection response clears it out.
4) iterate for each upadte till actionPerformed!
I'm working on developing a Component for the purpose, was just a little pressed on time and wondering what the best sort algorithm would be. When its ready, i'll try to post it here!
[ December 23, 2002: Message edited by: saager mhatre ]