title: How to know which JCheckBox sent ItemEvent
body: <p>I have a number of checkboxes in my Swing Project. For each checkbox select/deselect a particular query is to be executed. I know one way of getting the source of checkbox is </p>
  
  <pre><code>public void itemStateChanged(ItemEvent e)  {
  if(e.getSource=="checkbox object")
  { 
  some code goes here; 
  }
  }
  </code></pre>
  
  <p>If i have small number of checkboxes than this solution is best but if i have many checkboxes then i have to write lengthy code. Is there a way to find the object of  checkbox that causes the event in a single command?</p>