Skip to Main Content

Java Programming

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!

Change JTable's row color on row selection

807603Jan 9 2008 — edited Jan 10 2008
Hello!

Everywhere I've looked they're only explaining how to draw rows in different colors WHEN THE TABLE IS BEING CREATED, via prepareRenderer.

But that is not what I am looking for. What I want is to actually change the row's color after the table has been drawn/rendered/whatsoever. For instance, when the user clicks on that row. The default behaviour is for the row to become blueish, but, when the user selects another row, the first selected row turns back to white. I would like to prevent that from happening. I want the row to become FIRE RED when the user clicks on it, and I want the row to remain like that for good, even when the user selects a different row. Do I make any sense here? :-)

Thank you for your time and future suggestions.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 7 2008
Added on Jan 9 2008
6 comments
425 views