title: Rendering Toedter's JDateChooser in JTable column
body: <p>Excuses for asking the same question again. I am under the impression that if I added to the original question, I wouldn't get as many views.</p>
  
  <p>As I'm using an MVC pattern, my Swing GUI is in a different class with the controller creating an instance of it. Here is how I create the table in my View:</p>
  
  <pre><code>tableVehiclePermitHeader = new String[] {"Name", "Expiration Date"};
          tableVehiclePermitData = new Object[0][0];
  
  
  //      Calendar tempDate = new GregorianCalendar(2008, 1, 1);
  //      Date tempDate1 = new Date(2008, 1, 1);
  //      tempDate1.setYear(tempDate1.getYear() - 1900);
  //      tableVehiclePermitData = new Object [][] {{"Hello", tempDate}, {"Hello", tempDate1}};
  
          tableVehiclePermitDefaultTableModel = new DefaultTableModel(tableVehiclePermitData, tableVehiclePermitHeader);
          tableVehiclePermit = new JTable(tableVehiclePermitDefaultTableModel){
              public Class getColumnClass(int c) {
                  return getValueAt(0, c).getClass();
               }
  
              public boolean isCellEditable(int rowIndex, int colIndex){
                  if (colIndex == 0){
                      return false;
                  } else {
                      return true;
                  }
              }
          };
  
          tableVehiclePermit.getColumn("Expiration Date").setCellRenderer(new JDateChooserRenderer());
          tableVehiclePermit.getColumn("Expiration Date").setCellEditor(new JDateChooserCellEditor());
  </code></pre>
  
  <p>The commented lines show the JDateChooser correctly. It is only when I populate the table content from my view that I'm unable to render dates as JDateChoosers.</p>
  
  <p>Below is my renderer:</p>
  
  <pre><code>public class JDateChooserRenderer extends JDateChooser implements TableCellRenderer{
  
      Date inDate;
  
      @Override
      public Component getTableCellRendererComponent(JTable table, Object value,
              boolean isSelected, boolean hasFocus, int row, int column) {
          // TODO Auto-generated method stub
  
          if (value instanceof Date){
              this.setDate((Date) value);
          } else if (value instanceof Calendar){
              this.setCalendar((Calendar) value);
          }
          return this;
      }
  }
  </code></pre>
  
  <p>Finally, my Controller where I get the data to populate the table from a database as an ArrayList of a defined type that has the date fields as type java.util.Date (also tried java.sql.Date to the same result).</p>
  
  <pre><code>ArrayList&lt;VehiclePermitExpirationByVehicleDao&gt; vehPermit = vpmodel.permitExpirationPerVehicle(id);
          VehiclePermitExpirationByVehicleDao permitData;
          permitListData = new Object[vehPermit.size()][3];
          Iterator it = vehPermit.iterator();
          int i = 0;
          while (it.hasNext()){
              permitData = (VehiclePermitExpirationByVehicleDao) it.next();
              permitListData[i][0] = permitData.getVehiclePermitName();
              permitListData[i][1] = permitData.getExpirationDate();
              permitListData[i][2] = permitData.getVehiclePermitId();
              i++;
          }
          gui.setTableVehiclePermitData(permitListData);
          gui.getTableVehiclePermitDefaultTableModel().setDataVector(gui.getTableVehiclePermitData(), gui.getTableVehiclePermitHeader());
          gui.getTableVehiclePermit().setModel(gui.getTableVehiclePermitDefaultTableModel());
          gui.getTableVehiclePermit().setEnabled(true);
  </code></pre>
  
  <p>Can someone please advise what I'm doing wrong? My suspicion is the type of the column holding the dates.</p>
  
  <p>Also, if anyone had an idea how to go about the editor, kindly let me know.</p>
  
  <p>Regards.</p>