• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do you increase the size of a JTable header

 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to make the height of the column headers for a JTable.

Thanks.
 
Jeff Bosch
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried setRowHeight?
 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't want every row to be larger, just the column headers.
 
Jeff Bosch
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can specify which row. I believe the column headers are the first row. Perhaps setPreferredSize, inherited from Component, can be invoked on the JTableHeader object...

(These are not absolute answers, but things to try. I've never had cause to do this before.)
[ November 09, 2004: Message edited by: Jeff Bosch ]
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Barry,

Try the following code, it will work.

JTableHeader th = jTable1.getTableHeader();
th.setPreferredSize(new Dimension(100, 100));
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic