Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the font of a JTable's header?

I want to set the JTable header's font. Do you know how?

like image 824
Stefanos Kargas Avatar asked Dec 10 '10 12:12

Stefanos Kargas


3 Answers

This should work:

    table.getTableHeader().setFont(new Font("SansSerif", Font.ITALIC, 12));
like image 165
dogbane Avatar answered Oct 20 '22 10:10

dogbane


JTableHeader header = table.getTableHeader();
header.setFont(new Font("Dialog", Font.BOLD, 18));
like image 3
Michel Avatar answered Oct 20 '22 11:10

Michel


You should implement TableCellRenderer.

like image 2
Argiropoulos Stavros Avatar answered Oct 20 '22 11:10

Argiropoulos Stavros