title: JTable chokes on custom renderer
body: <p>I have a custom renderer in a <code>JTable</code>.  When my <code>JTable</code> displays, I get a <code>NullPointerException</code> on <code>JTable.prepareRenderer()</code>.  I'm not sure what part of my custom renderer isn't preparable, but I'm sure it's my fault.</p>
  
  <p>Condensed version of my renderer (full version at <a href="http://github.com/mathphreak/MYGP/blob/master/src/net/sourceforge/mygp/view/GradeRenderer.java" rel="nofollow">this spot</a>):</p>
  
  <pre><code>public class GradeRenderer extends JLabel implements TableCellRenderer {    
      public Component getTableCellRendererComponent(JTable table, Object grade,
              boolean isSelected, boolean hasFocus, int row, int column) {
          if (grade == null) return new JLabel();
          Grade myself = (Grade) grade;
          int score = myself.getScore();
          setText(String.valueOf(score));
          Assessment thing = myself.getThing();
          GradeStatus status = myself.getStatus();
          AssessmentType type = thing.getType();
          // do some work with status
          // do some work with type
          return this;
      }
  }
  </code></pre>
  
  <p>Code where I add the renderer (full version <a href="https://github.com/mathphreak/MYGP/blob/master/src/net/sourceforge/mygp/view/GradeEntry.java" rel="nofollow">here</a>):</p>
  
  <pre><code>model = new GradeEntryModel();
  table = new JTable(model);
  // some work with table
  table.setDefaultRenderer(Grade.class, new GradeRenderer(true));
  </code></pre>
  
  <p>Any pointers as to where I've gone wrong?</p>