How do I change the font of the TableHeader in the JTable.

Sandip Chitale

The JTableHeaders use the CellRenderers similar to JTables. Thus by installing a cell renderer set with the desired font should do the trick.

There are two ways to set the JTableHeader's cell renderer

  • tableHeader.setDefaultRenderer(TableCellRenderer defaultRenderer); // for all columns
  • tableColumn.setHeaderRenderer(TableCellRenderer headerRenderer); // column by column basis
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact