开发者

JTabbedPane tab height with nimbus

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 th开发者_C百科e background of the tab is not painted anymore.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜