Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create vertical tabs in Java?

I would like to get the effect like if JTabbedPane would be turned 90 degrees counterclockwise (only tabs but not the content inside tabs). What is the best way to implement that in Java?

like image 781
bancer Avatar asked Jun 17 '11 18:06

bancer


2 Answers

In this solution:

http://oreilly.com/pub/a/mac/2002/03/22/vertical_text.html

The text was painted vertically and tried as an icon on the tab. This way you don't have to modify JTabbedPane you just use a custom Icon in the tab.

Of course you would also have to specify the tab placement to be on the Left.

like image 141
jzd Avatar answered Sep 20 '22 20:09

jzd


You can specify the placement in the constructor:

http://download.oracle.com/javase/6/docs/api/javax/swing/JTabbedPane.html#JTabbedPane%28int%29

or in the setter:

http://download.oracle.com/javase/6/docs/api/javax/swing/JTabbedPane.html#setTabPlacement%28int%29

like image 31
Puce Avatar answered Sep 22 '22 20:09

Puce