Responding to Checkbox
public void itemStateChanged(ItemEvent e)
{ //make sure the source is a checkbox
if (e.getSource() instanceof Checkbox)
//get state of the checkbox (boolean)
boolean b = cb.getState ();
The listener for Checkbox is ItemListener.