You’ve seen those auto-complete combo boxes out there. SwingX has one, and it is a good one, but not exactly what I needed. I didn’t want all of the highlighting and I didn’t want the options in the combo box to be static. All my suggestions are coming from the database.
So what I discovered and what I want to share is how to listen for key events on an editable jComboBox. If you did something like this:
jComboBox1.addKeyListener(new KeyListener() { ... }
You would not be notified of KeyEvents. Why? you ask. When you type into an editable JComboBox the key events are not being fired on the JComboBox but rather on the editor of that JComboBox.
jComboBox1.getEditor().getEditorComponent().
addKeyListener(new KeyListener() { ... });
Simple as that!

January 8th, 2009 at 11:13 pm
Whoa! Amazing! This really fixed my problem.
Thanks!
July 6th, 2010 at 7:44 pm
it’g great. Thank you a lot. I can solve my big problem. Have a nice day!!!
December 14th, 2011 at 1:07 am
thanks , i was adding another class in place of KeyListener
thanks
January 4th, 2012 at 3:39 am
Hi ,really thanks! It was more than an hour I tried to do that!
January 19th, 2012 at 11:34 pm
Thank you very much….:D
April 9th, 2012 at 11:37 pm
Thank from Italia.