code: public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
      {
          this.setControlValue(value);
          if (isSelected && !hasFocus) {
              this.setForeground(table.getSelectionForeground());
              this.setBackground(table.getSelectionBackground());
          }
          else {
              this.setForeground(table.getForeground());
              this.setBackground(table.getBackground());
          }
          return this;
      }
docs: Get the renderer for this location in the table.
  From the TableCellRenderer interface.
  Sets the value of this control and returns this.
  @return this.