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

Stefanos Kargas picture Stefanos Kargas · Dec 10, 2010 · Viewed 34.2k times · Source

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

Answer

dogbane picture dogbane · Dec 10, 2010

This should work:

    table.getTableHeader().setFont(new Font("SansSerif", Font.ITALIC, 12));