title: Trying to color specific cell in JTable... getTableCellRendererComponent Overide
body: <p>So I know this may be a duplicate question, but I've looked through many of the ones already on here and none of them seem to work for me, so I thought I would post my own and hopefully some of the other people having trouble with this will find this helpful also.</p>
  
  <p>Here is my code</p>
  
  <pre><code>    table.getColumn("Name").setCellRenderer(
                  new DefaultTableCellRenderer() {
                      @Override
                      public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
                          setText(value.toString());
  
                          if (row==3) 
                          {
                              setForeground(Color.RED);
                          }
                          return this;
                      }
                  }
              );
  </code></pre>
  
  <p>Here is what is displayed in the JFrame. As you can see I am trying to to only color the text in the third row of the  Column "Name" but it colors the whole row.
  <img src="https://i.stack.imgur.com/Roj15.png" alt="enter image description here"></p>
  
  <p>Any suggestions?
  Thanks!
  Canaan</p>