How can I prevent cell highlighting in a JTable?
Created May 7, 2012
Scott Stanchfield The easiest way to accomplish this is to use a custom cell renderer that doesn't paint a background.
Search the Swing FAQ for "TableCellRenderer"; there are many FAQs about how to create one. If you create a table cell renderer that uses a label (or subclasses DefaultTableCellRenderer), all you need to do is call
setOpaque(false);
in your getTableCellRendererComponent() method.