Definition:
The ItemListener interface is used to handle item events triggered by graphical components that implement the ItemSelectable interface (e.g., JComboBox, JCheckBox, JRadioButton, etc..).
It's a simple interface that only requires a class to implement one method:
public interface ItemListener {
public void itemStateChanged(ItemEvent e);
}
Example:
You can attach an ItemListener event listener as an anonymous inner class to a JComboBox:
//Options for the combo box dialog
String[] choices = {"Monday", "Tuesday"
,"Wednesday", "Thursday", "Friday"};
JComboBox weekDays = new JComboBox(choices);
//Attach an ItemListener to weekDays by using
//an anonymous inner class
weekDays.addItemListener(new ItemListener(){
@Override
public void itemStateChanged(ItemEvent e)
{
//place the code to execute when the item event
//triggers
}
});
Have a look at How to Handle Item Events and a ItemListener Example Code Program.

