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!

TableHeader text alignment

843806Jun 24 2009 — edited Nov 19 2009
Is there a way to set the alignment differently for different columns of a JTable?

For some columns, I want my header text centered, for others I want it left aligned.

I would like to avoid replacing the TableHeader's default renderer with my own because I like its L & F (I'm using Nimbus).

I just want to be able to control the text alignment in the header on a column by column basis.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 17 2009
Added on Jun 24 2009
4 comments
1,629 views