aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How do you increase the size of a JTable header Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How do you increase the size of a JTable header" Watch "How do you increase the size of a JTable header" New topic
Author

How do you increase the size of a JTable header

Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
I would like to make the height of the column headers for a JTable.

Thanks.
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 804
Have you tried setRowHeight?


Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)
Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
I don't want every row to be larger, just the column headers.
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 804
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

Joined: Aug 20, 2004
Posts: 138
Hi Barry,

Try the following code, it will work.

JTableHeader th = jTable1.getTableHeader();
th.setPreferredSize(new Dimension(100, 100));


Download Java GUI Builder, <a href="http://www.mars3000.com" target="_blank" rel="nofollow">http://www.mars3000.com</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do you increase the size of a JTable header
 
Similar Threads
JTable
Jtable
JTable
jtable