Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Column Header in JTable

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all ,
can we set the font of column header of a JTable .
please reply soon ..
thanks .
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic