mgarin / weblaf

WebLaF is a fully open-source Look & Feel and component library written in pure Java for cross-platform desktop Swing applications.
http://weblookandfeel.com
GNU General Public License v3.0
1.15k stars 235 forks source link

Leading and trailing components for JTabbedPane tab area #539

Closed mgarin closed 5 years ago

mgarin commented 5 years ago

Once #35 is implemented in v1.2.10 update I'll be free to add new features to JTabbedPane and the first one that is often requested is possibility to add leading/trailing components to the tab run (before and after the tabs).

Since new JTabbedPane UI implementation will be using custom containers for all of it's parts - it will be pretty easy to add and will surely be worth it.

mgarin commented 5 years ago

Support for leading and trailing TabArea components have been added.

To setup/retrieve leading or trailing component you can use these methods of WebTabbedPane:

public JComponent getLeadingTabAreaComponent ()
public JComponent setLeadingTabAreaComponent ( JComponent )
public JComponent getTrailingTabAreaComponent ()
public JComponent setTrailingTabAreaComponent ( JComponent )

You can also use these properties with JTabbedPane as well through property constants:

WebTabbedPane.LEADING_TAB_AREA_COMPONENT_PROPERTY.get ( tabbedPane );
WebTabbedPane.LEADING_TAB_AREA_COMPONENT_PROPERTY.set ( tabbedPane, component );
WebTabbedPane.TRAILING_TAB_AREA_COMPONENT_PROPERTY.get ( tabbedPane );
WebTabbedPane.TRAILING_TAB_AREA_COMPONENT_PROPERTY.set ( tabbedPane, component );

These changes will be available in v1.2.11 update.