JTabbedPane: Components before and after the tabs themselves

蹲街弑〆低调 提交于 2019-12-01 14:56:46

I finally asked Kirill of Substance LaF/laf-widget of how he manages to put a button in front of the tabs in the laf-widget that decorates JTabbedPanes, and this is his reply:

It relies on the BasicTabbedPaneUI.tabAreaInsets field to make room for the button, and custom setBounds of the button component to position itself in that area.

For more code, see TabOverviewButton and TabOverviewDialogWidget classes in the laf-widget project.

In general, the tabbed pane UI delegate is one of the least attractive ones to enhance since it has a lot of private and package protected methods

Thanks, Kirill!

JIDE have a tabbed pane as part of their component suite that exposes this functionality as simple setBeforeComponent() and setAfterComponent() methods.

There's a demo of it in here: http://www.jidesoft.com/products/1.4/jide_demo.jnlp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!