If you are referring to the focus rectangle that you see around the table cells, then you need to implement a custom cell renderer. The following renderer would print the text returned by toString() method of the object.
public class NoFocusStringCellRenderer extends JLabel
implements TableCellRenderer {
public NoFocusStringCellRenderer() {
super();
setOpaque(true);
}
public Component getTableCellRendererComponent(
JTable table, Object value,
boolean isSelected, boolean hasFocus,
int row, int column) {
if(isSelected) {
setBackground(table.getSelectionBackground());
setForeground(table.getSelectionForeground());
}
else {
setForeground(table.getForeground());
setBackground(table.getBackground());
}
setText(value.toString());
return this;
}
}
You would set it as the default renderer for class type String as follows:
table.setDefaultRenderer(String.class, new NoFocusStringCellRenderer());
Hope it helps
Max