File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JTable doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable doubt" Watch "JTable doubt" New topic

JTable doubt

tadi raja
Ranch Hand

Joined: Jul 07, 2008
Posts: 109
how to rotate JLabel text in JTable header ???
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10826

Originally posted by tadi raja:
how to rotate JLabel text in JTable header ???

Just like JTable, you can set a renderer to the JTableHeader.
You will have to create a custom component for the renderer whose paintComponent will handle the rotation part.
Take a look at Graphics2D#translate and Graphics2D#rotate methods.

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
I agree. Here's the link:
subject: JTable doubt
It's not a secret anymore!