How to change JTable header height?

后端 未结 6 1729
一整个雨季
一整个雨季 2020-12-29 07:51

Title explains the question. How can I easily do that?

6条回答
  •  情话喂你
    2020-12-29 08:17

    Font bigFont = new Font("sansserif", Font.PLAIN, 24); // or whatever
    myTable.getTableHeader().setFont(bigFont);
    

    This is a simple way to increase the preferredSize of the TableHeader. It will increase the height of the header, but if your column names are too long then they might not fit widthwise.

提交回复
热议问题