JTabbedPane: Components before and after the tabs themselves

前端 未结 2 1673
刺人心
刺人心 2021-01-17 06:31

This is similar to the question How to build a Google-chrome tabs and menubar interface in Java Swing? (I want to accomplish the same), but more to the point: How do I put c

2条回答
  •  粉色の甜心
    2021-01-17 07:11

    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!

提交回复
热议问题