I have editable JCombobox and I added keylistener for combobox editor component. When user press \'Enter key\' and if there is no text on the editable combobox I need to dis
If you are using Netbeans then right click on your combobox and select customize code. add following lines of code
JTextComponent editor = (JTextComponent) Code.getEditor().getEditorComponent();
editor.addKeyListener(new KeyAdapter() {
public void keyReleased(KeyEvent evt) {
if(evt.getKeyCode()==10)
//do your coding here.
}
});