JTable ---> Row selection background color
843805Mar 22 2007 — edited Mar 22 2007Hello,
I am using an image as a background for my JTable. To do so, I had to install a renderer:
public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
{
Component c = super.prepareRenderer( renderer, row, column);
c.setForeground(Color.BLUE); //change foreground
((JComponent) c).setBorder(null); //remove cell borders
if( c instanceof JComponent)
((JComponent)c).setOpaque(false);
return c;
}
The last three lines above prevent me from seeing which rows are selected.
Is there a command to enable having a background image and see the background color of the selected rows as well?
Thanks