Sure. Setting a JTable column header’s background color is very easy. Just call
|
1 |
table.getTableHeader().setBackground(Color.red); |
But once you run it, there may be times you will not see any changes. I am not sure if this happens all the time but this surely did happen to me and it took me a very, very long time to figure out how to make this work.
All it took was one method call.
|
1 |
table.getTableHeader().setOpaque(false); |
Do that, and your background color should now appear.