public Component getTableCellRendererComponent( JTable t, Object o, boolean is, boolean hf, int r, int c) { Component cell = super.getTableCellRendererComponent(t, o, is, hf, r, c); EventResultModel m = (EventResultModel) t.getModel(); String s = (String) m.getValueAt(r, 1); if (s.equals(match)) { cell.setFont(bold); cell.setBackground(mygray); } else { cell.setFont(regular); cell.setBackground(Color.WHITE); } return cell; }
@Override public void event(MT type, Object o) { switch (type) { case RUN_CHANGED: Entrant e = (Entrant) o; String classcode = e.getClassCode(); nameLabel.setText("Driver: " + e.getName()); nameModel.setData(e); details.setData(e.getRuns()); classLabel.setText("Class: " + classcode); classModel.setData(Database.d.getResultsForClass(classcode)); renderer.setHighlightValue(e.getFirstName() + " " + e.getLastName()); break; } }