How to avoid firing actionlistener event of JComboBox when an item is get added into it dynamically in java?

后端 未结 9 2267
广开言路
广开言路 2020-12-04 00:23

I need your suggestions and guidence on following task.

I have a frame which has two JComboBoxes supposed they are named combo1 and combo2, a JTable and other compon

9条回答
  •  再見小時候
    2020-12-04 00:32

    although its late, a better alternative would be to disabled the combobox to be modified prior to being modified. by doing so, you prevent firing events of the modified combobox, when for example, you use methods likes removeAllItems() or addItem()

    String orderByOptions[] = {"smallest","highest","longest"};
    
    JComboBox jcomboBox_orderByOption1 = new JComboBox jcomboBox_orderByOption2 = new JComboBox jcomboBox_orderByOption3 = new JComboBox

提交回复
热议问题