How to increase the Font of the title column in JTable Swing?

Daniel Pereira picture Daniel Pereira · Sep 16, 2011 · Viewed 10.2k times · Source

I would like to know how to increase the Font size of the title column in JTable Swing?

I'm usning Netbeans.

Best regards.

Daniel

Answer

Damian Leszczyński - Vash picture Damian Leszczyński - Vash · Sep 16, 2011

You just need to call the getTableHeader() method. Then on the object of class JTableHeader use the setFont(/*font*/) method to set new font.

table.getTableHeader().setFont( new Font( "Arial" , Font.BOLD, 15 ));