java itemstatechanged called twice

Solutions on MaxInterview for java itemstatechanged called twice by the best coders in the world

showing results for - "java itemstatechanged called twice"
Said
01 Jan 2021
1comboBox.addItemListener(new ItemListener() {
2	@Override
3    public void itemStateChanged(ItemEvent e) {
4      if(e.getStateChange() == ItemEvent.SELECTED) { // Check if the value got selected, ignore if it has been deselected
5        //Do stuff
6      }
7    }
8});