This week's book giveaway is in the Testing forum. We're giving away four copies of Data Structures the Fun Way: An Amusing Adventure with Coffee-Filled Examples and have Jeremy Kubica on-line! See this thread for details.
How are you rotating the text? By tweaking paint? You will have to use the FontMetrics to figure out the dimensions of the rendered font and then tweak the g.drawString()'s 'x' and 'y' co-ordinates accordingly.
Just out of curiosity, what exactly are you trying to do here by rotating the text?
That code works fine and i aligned at center when i was change that line of code to g2.drawString(this.getText(), 8, -52); but here one problem is that the rotated text added to JTableHeader,i was unable get both horizontal lines and vertical lines, it can applied for row data only not for the JTableHeader.