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!

How to set background color of a JTable Column

843804Jul 1 2002 — edited Jan 31 2005
Hi:
Having searched through the forum, I found that many responses misunderstood similar questions and tried to solve "How to set the COMPONENT'S BACKGROUND COLOR". However, I want to set the background color of the Column itself. My Component is a JLabel, so, setting its background has no effect whatsoever. I need to know how to set the background color of a specific JTable column when the table is first loaded, not when that row/cell is selected. JTable.setBackground(Color) will set the entire table, is there a similar method for a column only? Thanks very much.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 28 2005
Added on Jul 1 2002
9 comments
684 views