if (hasFocus) { setBackground(table.getBackground()); setBorder(UIManager.getBorder("Table.focusCellHighlightBorder")); } else setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
  public Component getTableCellRendererComponent(JTable table, Object value,                                                 boolean isSelected,                                                 boolean hasFocus,                                                 int row, int column)  {    if (value != null)      {        if (value instanceof JTextField)          return new JTextField(((JTextField)value).getText());      super.setText(value.toString());      }        setOpaque(true);    if (table == null)      return this;    if (isSelected && hasFocus)      {        setBackground(table.getBackground());        setForeground(table.getSelectionForeground());      }    else if (table.isRowSelected(row))      {        setBackground(table.getSelectionBackground());        setForeground(table.getSelectionForeground());      }    else      {        setBackground(table.getBackground());        setForeground(table.getForeground());      }    setEnabled(table.isEnabled());    setFont(table.getFont());    return this;  }