1

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.

jzd
  • 23,473
  • 9
  • 54
  • 76
wotan2009
  • 21
  • 3
  • 1
    Please 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 Answers1

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