I want to set the JTable header's font. Do you know how?
Asked
Active
Viewed 4.0k times
5 Answers
51
This should work:
table.getTableHeader().setFont(new Font("SansSerif", Font.ITALIC, 12));

dogbane
- 266,786
- 75
- 396
- 414
3
JTableHeader header = table.getTableHeader();
header.setFont(new Font("Dialog", Font.BOLD, 18));

Youcef LAIDANI
- 55,661
- 15
- 90
- 140

Michel
- 31
- 1
1
you can also use this to set all table's header's font :
UIManager.put("TableHeader.font", font1);

Hossein
- 11
- 1
0
This work for me
tableName.getTableHeader().setFont(new Font("Segoe UI", 1 , 16));

T.A.Chathura Priyahsad
- 103
- 8