java jcombobox selected item changed

Solutions on MaxInterview for java jcombobox selected item changed by the best coders in the world

showing results for - "java jcombobox selected item changed"
Hendrik
02 Jul 2018
1class ItemChangeListener implements ItemListener{
2    @Override
3    public void itemStateChanged(ItemEvent event) {
4       if (event.getStateChange() == ItemEvent.SELECTED) {
5          Object item = event.getItem();
6          // do something with object
7       }
8    }       
9}