aspose file tools
The moose likes Swing / AWT / SWT and the fly likes Centering the header of the columns in JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Centering the header of the columns in JTable" Watch "Centering the header of the columns in JTable" New topic
Author

Centering the header of the columns in JTable

Jeff Chang
Greenhorn

Joined: Aug 23, 2001
Posts: 23
hi,
I use the HTML (i.e. "<HTML><center>Name</center></HTML>") to boldface and center the text of the header for all the columns in a JTable. But I can only boldface the text but could not center them. Does anybody know how to solve this problem? Thanks.
Jeff
Renee Zhang
Ranch Hand

Joined: Sep 10, 2001
Posts: 72
use a center tag like "center" "/center" (In order to display the tag, I use "" instead of <>)
Good luck!
Jeff Chang
Greenhorn

Joined: Aug 23, 2001
Posts: 23
Yes, I did but it did not work.
Renee Zhang
Ranch Hand

Joined: Sep 10, 2001
Posts: 72
I used once and it works. Just make sure that you close all the tages. "html""center""font face=dialog""B" Bold table head "/font""/center""/html"
Good luck! In case it doesn't work, could you please post the source code.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Centering the header of the columns in JTable
 
Similar Threads
JTable ........
JTable
How to boldface the header for ONE column
jtable
boldfacing the header of a column in a JTable