Is it possible for JTable column headers to be verticaly aligned?

1.7k Views Asked by At

I'm working on a hotel booking timeline feature for hotel management system. I have a JTable where rows represent rooms and columns represent days. If room is booked for that day, the corresponding cell is highlighted. Since these cells don't have any content and only serve to visually represent days when the rooms are booked, it seems rather pointless for them to have width larger then height. But if I adjust them to be equal column headers containing days are shortened and instead of "02.01.2012." all I see is "...". Since this is not an option I was wondering is it possible to "rotate" the header cells so the text in them is aligned vertically.

1

There are 1 best solutions below

1
On BEST ANSWER

You may use the method described in Vertical Table Header Cell Renderer to show the header text in a vertical manner.