How to change the font size for strings in a JTable?

razshan picture razshan · Jun 1, 2011 · Viewed 37.8k times · Source
String columnNames[] = {"Time","MAP","ICP","CPP"};
String dataValues[][]= new String [countery]

table = new JTable( dataValues, columnNames );

I am working on a table and storing string values in dataValues. I am curious to know if there is anyway to increase the font size from the default size (which is I assume regular 11 font). This brings my other question...even font color?

Answer

mKorbel picture mKorbel · Jun 1, 2011
table.setFont(new Font("Serif", Font.BOLD, 20));