How can I put text in Tab into vertical alignment?

Dear friends, I have following code,

package com.swing.test;

import java.awt.BorderLayout;

import javax.swing.JFrame;

import javax.swing.JPanel;

import javax.swing.JTabbedPane;

import javax.swing.SwingConstants;

publicclass NewTabbedPane{

private JFrame frame;

/**

* Launch the application

* @param args

*/

publicstaticvoid main(String args[]){

try{

NewTabbedPane window =new NewTabbedPane();

window.frame.setVisible(true);

}catch (Exception e){

e.printStackTrace();

}

}

/**

* Create the application

*/

public NewTabbedPane(){

initialize();

}

/**

* Initialize the contents of the frame

*/

privatevoid initialize(){

frame =new JFrame();

frame.setBounds(100, 100, 500, 375);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

final JPanel panel =new JPanel();

panel.setLayout(new BorderLayout());

frame.getContentPane().add(panel, BorderLayout.CENTER);

final JTabbedPane tabbedPane =new JTabbedPane();

tabbedPane.setTabPlacement(SwingConstants.LEFT);

panel.add(tabbedPane, BorderLayout.CENTER);

final JTabbedPane tabbedPane_1 =new JTabbedPane();

tabbedPane.addTab("AAAAA", null, tabbedPane_1,null);

final JTabbedPane tabbedPane_2 =new JTabbedPane();

tabbedPane.addTab("BBBBB", null, tabbedPane_2,null);

final JTabbedPane tabbedPane_3 =new JTabbedPane();

tabbedPane.addTab("CCCCC", null, tabbedPane_3,null);

}

}

but here all tabs' title AAAAA, BBBBB, CCCC are aligned horizontally, I need them to align vertically, Any guru can help?

Thanks

sunny

[3392 byte] By [sunnymanmana] at [2007-11-26 19:42:17]
# 1
[nobr]//tabbedPane.addTab("AAAAA", null, tabbedPane_1, null);tabbedPane.addTab("<html>A<br>A<br>A<br>A<br>A</html>", null, tabbedPane_1, null);[/nobr]
Michael_Dunna at 2007-7-9 22:24:11 > top of Java-index,Desktop,Core GUI APIs...
# 2
Great!!, thanks so much!Any way to turn each Letter around so that A's head toward west direction instead of now heading toward north direction?Thankssunny
sunnymanmana at 2007-7-9 22:24:11 > top of Java-index,Desktop,Core GUI APIs...
# 3

there's an example here (works OK on winxp)

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

Test() class needs a small change, for the direction you want

//panel.add(makeTabpane(null, sEnglish, VTextIcon.ROTATE_DEFAULT));

panel.add(makeTabpane(null, sEnglish, VTextIcon.ROTATE_LEFT));

Michael_Dunna at 2007-7-9 22:24:11 > top of Java-index,Desktop,Core GUI APIs...
# 4
If you're willing to use a third-party look and feel : https://substance.dev.java.net/docs/clientprops/TabbedPaneVerticalOrientation.html
kirillga at 2007-7-9 22:24:11 > top of Java-index,Desktop,Core GUI APIs...
# 5
Thanks so much guys, really appreciate it!!
sunnymanmana at 2007-7-9 22:24:11 > top of Java-index,Desktop,Core GUI APIs...
# 6

Very good, I tested success, but the Text height is still too high, anyway I can reduce or change its text height so that eg with text "AAAAAAA",

top ceiling and bottom just tightly wrapped "AAAAAAA", there is no space between ceiling and AAAAAA and between AAAAAAA and bottom.

any way to change?

Thanks again

Sunny

sunnymanmana at 2007-7-9 22:24:11 > top of Java-index,Desktop,Core GUI APIs...
# 7
if you're using the code from macdevcenter, add this as the first line of main()UIManager.put("TabbedPane.tabInsets",new javax.swing.plaf.InsetsUIResource(20,20,20,20));play around with the 20's
Michael_Dunna at 2007-7-9 22:24:11 > top of Java-index,Desktop,Core GUI APIs...
# 8
Great, thanks so much, success!!
sunnymanmana at 2007-7-9 22:24:11 > top of Java-index,Desktop,Core GUI APIs...