I am using the GlazedLists (1.8) library in my project, and I have been having trouble getting autocomplete working properly on my combo boxes. I installed a KeyListener
on comboBox.getEditor().getEditorComponent()
to catch when a user hits enter, so that I can do something based on what item they select in the combo box.
I installed it on the JComboBox fine, and filtering works, but when I use the arrow keys to change the selection a call to comboBox.getSelectedItem()
returns what was selected before using the arrow keys to change the selection.
Also, when this happens (using the arrow keys), a call to comboBox.getSelectedIndex()
returns -1
.
I would assume that I don't have to deal with key events to change the selection myself (that should be a part of GlazedLists' code), so does anyone have any idea if this is a bug or if I am doing something wrong? I googled for a while but didn't find this bug.
EDIT: I am fairly sure this is a bug now. I tried running it on Windows and it worked fine, but it seems to choke on OS X. OS X's LnF seems to cause a lot of bugs in GlazedLists.