[英]What is the difference between adding a KeyListener to JCombobox editor and JCombobox itself
listItemsCombo.getEditor().getEditorComponent().addKeyListener(new keyPressListener()); //Works correct
这很好用。 但是,在将keyListener添加到jcomboBox时,按下“Enter”时keyPress没有得到重新识别。 将keyListener添加到jComboxBox并将监听器添加到其编辑器之间的确切区别是什么?何时将监听器添加到编辑器?
listItemsCombo.addKeyListener(new KeyPressListener())//When should we use this?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.