Class ToggleableTabbedPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants

public class ToggleableTabbedPane extends JTabbedPane
A custom JTabbedPane that allows toggling tab header visibility at runtime. With the tab pane hidden, this component behaves pretty much like a panel with CardLayout, where you can still programmatically flip between the tabs, but the user can no longer see the tab header and can no longer use the mouse to switch between tabs. This is great for adding hidden tabs and then having a way to show/hide the tab bar at runtime.
Author:
claude.ai wrote most of this one!
See Also:
  • Constructor Details

    • ToggleableTabbedPane

      public ToggleableTabbedPane()
    • ToggleableTabbedPane

      public ToggleableTabbedPane(int tabPlacement)
    • ToggleableTabbedPane

      public ToggleableTabbedPane(int tabPlacement, int tabLayoutPolicy)
  • Method Details

    • setTabHeaderVisible

      public void setTabHeaderVisible(boolean visible)
      Sets whether the tab headers should be visible.
      Parameters:
      visible - true to show tab headers, false to hide them
    • isTabHeaderVisible

      public boolean isTabHeaderVisible()
      Returns whether the tab headers are currently visible.
      Returns:
      true if tab headers are visible, false otherwise
    • toggleTabHeaderVisibility

      public void toggleTabHeaderVisibility()
      Toggles the visibility of tab headers.
    • updateUI

      public void updateUI()
      Overrides:
      updateUI in class JTabbedPane