View Single Post
  #2 (permalink)  
Old 05-31-2007, 11:12 PM
levent levent is offline
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
If you know the column in the model that the test value will reside in, set it as a constant and your could would end up looking like this.

Code:
public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col) { Component comp = super.getTableCellRendererComponent( table, value, isSelected, hasFocus, row, col); String s = table.getModel().getValueAt(row, VALIDATION_COLUMN ).toString(); if(s.equalsIgnoreCase("Fail")) { comp.setForeground(Color.red); } else { comp.setForeground(null); } return( comp ); }
Reply With Quote