Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vertical headers in JTable?

Tags:

java

swing

jtable

Is there a way to rotate 90º the column headers of a JTable?

like image 858
Gabriel Avatar asked Jun 27 '10 20:06

Gabriel


2 Answers

Check out Darryl's Vertical Table Header Cell Renderer.

like image 174
camickr Avatar answered Nov 15 '22 04:11

camickr


This is little tricky. At first, you need to cast JTable headers to JLabels. It's just like

 ((JLabel)table.getTableHeader()

Then rotate JLabels. It's already answered here on StackOverflow

like image 25
Xorty Avatar answered Nov 15 '22 05:11

Xorty