I would like the change the height tab's tabbedpane, and to do so I tried several method without any success. First I tried with a spacer icon, the height is good, but the text of the tab is not center anymore. Then I tried to change Nimbus L&F properties, TabbedPane.tabInsets, TabbedPane:TabbedPaneTab.contentMargins, and TabbedPane:TabbedPaneTabArea.contentMargins nothing change. Finally I tried to extend BasicTabbedPaneUI and overide calculateTabHeight, but the background of the tab is not painted anymore.
Asked
Active
Viewed 996 times
1
-
1Please post questions from a single account [wotan2009](http://stackoverflow.com/users/671899/wotan2009). – trashgod Mar 23 '11 at 18:45
-
see [Java Swing: How can you alter the margins in Nimbus Look and Feel](http://stackoverflow.com/q/718977/307767) – oliholz Apr 15 '11 at 07:55
1 Answers
1
Just use setTabComponentAt
to set a custom component on the tab. You can set any component you want. If you just want a label with a bigger height, give setComponentAt
a JLabel with a border, or with its preferredSize set.

barjak
- 10,842
- 3
- 33
- 47
-
I just tried, it changes the tab content, but it is not for setting the tab title. – wotan2009 Mar 23 '11 at 22:28
-