title: Order of listeners in Java
body: <p>I wrote my own table cell editor that extends an <code>AbstractCellEditor</code> and implements a <code>TableCellEditor</code>, an <code>ItemListener</code>, and a <code>MouseListener</code>. Is there a way I can have the <code>mouseClicked</code> method be executed first before the <code>itemStateChanged</code> method?  I'm trying to do the following:</p>
  
  <pre><code>private int rowClicked;
  private JTable table;
  
  public void itemStateChanged(ItemEvent e) {
    if (rowClicked == 5) {
      // Do something to row 5.
    }
  }
  
  public void mouseClicked(MouseEvent e) {
    Point p = e.getPoint();
    rowClicked = table.rowAtPoint(p);
  }
  </code></pre>