title: Cell Renderer for JTable - coloured rows
body: <p>I've been looking around for a solution to this and I can't make head nor tail from various places of how to get my table to do coloured rows without asking my own question.</p>
  
  <p>From every place I've looked I gather I need to use a cell renderer but the problem is I don't know how to apply it to my own situation.</p>
  
  <p>So I have a simple JTable with 3 columns and I simply want each row to be highlighted in either green, yellow or red depending on the value of a separate variable (not displayed in the table).</p>
  
  <p>It seems like it should be really simple but I can't get how to do it. If it helps my table is defined like:</p>
  
  <pre><code>studentTableModel = new DefaultTableModel(new Object[]{"Name", "StudentNo", "Part"}, 0);
  jt_studentTable = new JTable(studentTableModel);
  jt_studentTable.getColumnModel().getColumn(2).setPreferredWidth(10);
  studentTableModel.addRow(new Object[]{"(empty)", "(empty)", "(empty)"});
  JScrollPane jsp_tableScroller = new JScrollPane(jt_studentTable);
  jsp_tableScroller.setPreferredSize(new Dimension(200,190));
  middleCentrePanel.add(jsp_tableScroller);
  </code></pre>
  
  <p>The rows in the table change depending of the selection of a combo box.</p>
  
  <p>Thanks in advance.</p>