I have a jxtable. If validation failed, I like the cell to be red at all time. If validation passed, I like the cell to be white if it is not selected, yellow if it is selected. Yellow and white works fine but red only shows up when the cell/row is selected. Following is my custom renderer. What do I do wrong?

Thank you!!

Java Code:
	/**
	 * renderer for my table	 *
	 */
	 public class MyCellHighlighter extends DefaultTableCellRenderer {

	     int row = -1, col = -1;
	     JTable table;
	   
	     /**
	      * constructor
	      */
	     public MyCellHighlighter () {
	       super();
	       setOpaque(true); 
	     }
	     
	     /**
	      * set the colors for the cells
	      */
	     public Component getTableCellRendererComponent(JTable table, Object value, 
	         boolean isSelected, boolean hasFocus, int row, int col) {
	         
				
	         if(this.table == null) 
	         {
	             this.table = table;
	         }
	       
	         boolean valid = true;
	    	 
	         try {
	    	     valid = getIsValid();

	    	 } catch (Throwable e) {
	    		 handleException(e);
	    	 }
	          
	        // call super on the renderer
	        // set the highlight color
	        Component renderer = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
	        
	        if(value == null)
	        {
	          value = "";
	        }

	        // set the invalid background color if the cell is the data is blank or validation failed
	        if( (  value.toString().length() <= 0 || !valid  )
	        {
	        	renderer.setBackground(Color.red);
	        	renderer.setForeground(Color.black);
	        } 
	        
	        // if the cell is selected
	        else if(isSelected)
	        {
	          renderer.setBackground(Color.yellow);
	          renderer.setForeground(Color.black);
	        }
	        // otherwise paint the cell white
	        else
	        {
	        	renderer.setBackground(Color.white);
	        	renderer.setForeground(Color.black);
	        }
	        
	        return this;    
	     }
	 }