• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable Header

 
Vani Shastri
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

How do we make the text in the JTable Header appear bold and also increase its font size?

Thanks.
 
Anand Loni
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You can make Header text bold as follows-

//table is JTable instance
JTableHeader header = table.getTableHeader();
header.setFont(header.getFont().deriveFont(Font.BOLD));

same way you can change font size.

Regards,
Anand
 
Vani Shastri
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Anand. That was very helpful.
Have a nice day.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!