How can I know when the text of an editable JComboBox has been changed?

前端 未结 3 1004
一向
一向 2020-12-25 14:49

I have an editable JComboBox where I want to take some action whenever the text is changed, either by typing or selection. In this case, the text is a pattern and

3条回答
  •  盖世英雄少女心
    2020-12-25 15:50

    this sounds like the best solution

    jComboBox.getEditor().getEditorComponent().addKeyListener(new java.awt.event.KeyAdapter() {
    public void keyReleased(java.awt.event.KeyEvent evt) {    //add your hadling code here:
    
    }    });
    

提交回复
热议问题