title: DefaultTableCellRenderer getTableCellRendererComponent never gets called
body: <p>I need to render a <code>java.util.Date</code> in a <code>JTable</code>.  I've implemented a custom renderer that extends <code>DefaultTableCellRenderer</code> (code appears below).  I've set it as the renderer for the column, but the method <code>getTableCellRendererComponent()</code> never gets called.</p>
  
  <p>This is a pretty common problem, but none of the solutions I've seen work.</p>
  
  <pre><code>public class DateCellRenderer extends DefaultTableCellRenderer {
  
      String sdfStr = "yyyy-MM-dd HH:mm:ss.SSS";
      SimpleDateFormat sdf = new SimpleDateFormat(sdfStr);
  
      public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
  
  
          super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
  
          if (value instanceof Date) {
  
              this.setText(sdf.format((Date) value));
          }
          else
              logger.info("class: " + value.getClass().getCanonicalName());
  
          return this;
      }
  }
  </code></pre>
  
  <p>I've installed the custom renderer (and verified that it has been installed) like this:</p>
  
  <pre><code>DateCellRenderer dcr = new DateCellRenderer();
  table.getColumnModel().getColumn(2).setCellRenderer(dcr);
  </code></pre>
  
  <p>I've also tried </p>
  
  <pre><code>table.setDefaultRenderer( java.util.Date.class, dcr );
  </code></pre>
  
  <p>Any idea why the renderer gets installed, but never called?</p>