java jcombobox itemlistener only if value changed

Solutions on MaxInterview for java jcombobox itemlistener only if value changed by the best coders in the world

showing results for - "java jcombobox itemlistener only if value changed"
Marine
08 Sep 2018
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});