title: JTable + getColumnClass() returns null if a cell contains NULL
body: <p>I'm trying to sort my JTable by extending DefaultTableModel and overrriding  getColumnClass() as follows:</p>
  
  <pre><code> public Class getColumnClass(int c) {     
  
    return getValueAt(0, c).getClass();
  }
  </code></pre>
  
  <p>It works perfectly fine if there is no NULL in that table cell.
  So I modified it in following way:</p>
  
  <pre><code>  public Class getColumnClass(int c) {
  
  
    for(int rowIndex = 0; rowIndex &lt; data.size(); rowIndex++){
  
      Object[] row = data.get(rowIndex);
  
      if (row[c] != null) {
          return getValueAt(rowIndex, c).getClass();
      }
    }
    return getValueAt(0, c).getClass();
   }
  </code></pre>
  
  <p>Now, again, it works fine if there is atleast one cell in the column which is not NULL.
  But if all of the cells in the column is NULL, it doesn't work ('casue it returns nullPointerException).</p>
  
  <p>Please ............help....
  thanks in advance</p>
  
  <p>Hasan</p>