title: How do i add a customized CellEditorListener to my JTable?
body: <p>I start typing my code:</p>
  
  <pre><code>private void addMyCellEditorListener() {
  
      class MyCellEditorListener implements CellEditorListener
      {
          public MyCellEditorListener() {}
  
          public void editingCanceled(ChangeEvent e) {}
  
          public void editingStopped(ChangeEvent e) {
              if(row == 0 &amp;&amp; column &gt; 0)
                  rechargeTableWithFindedResults(graphicTable.getValueAt(row,column));
              else
                  dataTable.setValueAt(graphicTable.getValueAt(row,column),row,column);
          }
      };
  
      .... addCellEditorListener(new MyCellEditorListener());
  }
  </code></pre>
  
  <p>I would like my <code>graphicTable</code> to detect data changes into its cells by giving it a customized <code>CellEditorListener</code>, but I really can't understand how to add it.  I tried several times with a code like the following:</p>
  
  <pre><code>DefaultCellEditor editor = new DefaultCellEditor(new JTextLabel());
  editor.addCellEditorListener(new MyCellEditorListener());
  this.graphicTable.setCellEditor(editor);
  </code></pre>
  
  <p>... or:</p>
  
  <pre><code>this.graphicTable.setCellEditor(this.graphicTable.getCellEditor().addCellEditorListener(new MyCellEditorListener()));
  </code></pre>
  
  <p>... however these techniques give me a <code>NullPointerException</code> in both cases.</p>
  
  <p>I have looked around through forums to get a solution, but they are just getting me more confused.</p>
  
  <p>Every hint would be appreciated.</p>
  
  <p>Thanks in advance.</p>