• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1604
  • Last Modified:

diplay some columns of header as vertical text in JTable

Hello,
How can we display some columns of a header as a vertical text.
For example, I have a header like that:
String [] header = {"Column 1", "Column 2", "Column 3", "Column 4", "Column 5", "Column 6"};
and I want to show "Column 3", "Column 4" in vertical direction
Thank you very much
0
nphnhi
Asked:
nphnhi
  • 3
  • 2
1 Solution
 
CEHJCommented:
You'll need a custom header renderer. See

http://www.quepublishing.com/articles/article.asp?p=24142&rl=1
0
 
nphnhiAuthor Commented:
with this example, I couldn't find the way to do as I asked...
0
 
CEHJCommented:
You'll need to add to it something like the following in a JLabel:


http://www.subrahmanyam.com/javaapps/rotate/RotateTextDemo.html
0
 
nphnhiAuthor Commented:
sorry, but the RotateTextDemo used image to display a text
0
 
CEHJCommented:
That doesn't really matter - the renderer returns a Component. You can simply draw the image in its overridden paintComponent
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now