Java Editable JCombobox Keylistener event for Enter key

前端 未结 6 1823
太阳男子
太阳男子 2020-12-11 05:56

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

6条回答
  •  一向
    一向 (楼主)
    2020-12-11 06:54

    One option would be to replace the KeySelectionManager interface with your own. You want to replace the JComboBox.KeySelectionManager as it is responsible for taking the inputted char and returns the row number (as an int) which should be selected.

提交回复
热议问题