JComboBox Event Handling

Editable JComboBox (combo1.setEditable(true)) is not adhering to KeyEvents such as keyTyped() and keyReleased() events.How can I make a "Editable" JComboBox to adhere KeyEvents.
[198 byte] By [Giritharana] at [2007-10-2 21:03:53]
# 1

a comboBox is made up of many components.

when editable there is a JTextField

you need to get the textfield to add the keylistener

combo.getEditor().getEditorComponent().addKeyListener(new KeyAdapter()

other times you may need to cast it

((JTextField)combo.getEditor().getEditorComponent()).someMethod()

Michael_Dunna at 2007-7-13 23:49:02 > top of Java-index,Security,Event Handling...