This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes Column Header in JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Column Header in JTable" Watch "Column Header in JTable" New topic
Author

Column Header in JTable

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
hi all ,
can we set the font of column header of a JTable .
please reply soon ..
thanks .
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
To change all column headers you can try

or for individual columns you can try getting a reference to the renderer with

or you can set your own custom TableCellRenderer, either as a defaultRenderer for the JTableHeader or by TableColumn, in which you specify the font.
Nick Kocher
Greenhorn

Joined: Nov 24, 2004
Posts: 14
Hi,
as Craig Wood said, you can try creating your own TableCellRenderer and the class would look something like this:




Now you need just to set it on your columnheader
[ December 18, 2004: Message edited by: Nick Kocher ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Column Header in JTable