Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JTable ---> Row selection background color

843805Mar 22 2007 — edited Mar 22 2007
Hello,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 19 2007
Added on Mar 22 2007
3 comments
521 views