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}