Skip to main content

Spicing up your JTabbedPane - part VI

Posted by kirillcool on February 14, 2007 at 12:22 AM PST

This is the sixth part of the series that describes the additional capabilities that you can get on your tabbed panes.

  • The first part described close buttons and animation on modified tabs
  • The second part described vetoable close buttons and vertical tabs.
  • The third part described single-click close of multiple tabs and custom alignment of tab texts on left and right placement.
  • The fourth part described hover preview popup and tab overview dialog.
  • The fifth part described tab pager (enhanced since first described).

This entry describes the new feature available in the next version of Substance look-and-feel (code-named Japan) and any other third-party LAF using laf-widget layer.

The vast majority of code was written by Nigel Hughes and contributed to the laf-widget under Apache license. Nigel first introduced the carousel component back in December, and later in January followed up with carousel menu (inspired by Apple TV interface). I spent the last weekend integrating this functionality in the tab overview dialog that provided a grid overview up until now. The time was spent well on both sides, with Nigel graciously making numerous changes that i requested to both carousel and carousel menu (thanks for bearing with all my requests), and me enhancing the TabPreviewPainter class that defines the tabbed overview dialog functionality.

By default, the tab overview button will show the regular grid overview dialog. To show the new carousel functionality, override the public TabOverviewKind getOverviewKind(JTabbedPane tabPane) method of TabPreviewPainter or DefaultTabPreviewPainter and return either TabOverviewKind.ROUND_CAROUSEL or TabOverviewKind.MENU_CAROUSEL.

Here is an example of the TabOverviewKind.ROUND_CAROUSEL tab overview (the WebStart link is at the end):

Here is an example of the TabOverviewKind.MENU_CAROUSEL tab overview (the WebStart link is at the end):

In order to see this functionality in a WebStart demo, click the button below, wait for the application to load and:

  • Click the "General settings" task pane on the left hand side.
  • Select either "round carousel" or "menu carousel" in the "Overview kind" combo box (under "Miscellaneous" section).
  • Click the small button to the left of the tabs (the one with the magnifying glass

To view dynamically updating overview dialog (updating painting, automatic tracking of added and removed tabs) go to the "Tabbed Pane", configure its tab overview kind in the "Tabbed Pane" task pane and follow the instructions above.



Related Topics >>