title: How to set color to a certain row if certain conditions are met using java?
body: <p>I have A jtable. (tablesummary). one of it's column is EXPIRY. i want to highlight the row with the client whose expiry date already lapsed on the current date..</p>
  
  <p>i already got the logic but i can't make the row turn red or any other colors. 
  here's my code:</p>
  
  <pre><code>         int count = (tableSummary.getRowCount());
           NumberFormat formatter = new DecimalFormat("###,###");          
           String no = formatter.format(count);
           txtNo.setText(no);
  
              SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");     
              Calendar cal  = Calendar.getInstance();           
              String expDateString = sdf.format(cal.getTime()).toString();
  
              for(int i=0; i&lt;=tableSummary.getRowCount()-1; i++){
                  String nnn= tableSummary.getModel().getValueAt(i, 6).toString();   
                  System.out.println(nnn);
                  int res = nnn.compareTo(expDateString); 
                      if(res&gt;=0){
                          System.out.println("if ni " + (res&gt;=0));
                      }
                      else{ 
                          System.out.println("else ni" + (res&gt;=0));
                          rowrenderer.setBackground(Color.RED);
  
  
                      }                        
              }
  </code></pre>
  
  <p>can anyone help me with this? because it's one of the main highlight of my interface.
  Thanks in advance !! :)</p>