Class CollapsiblePanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class CollapsiblePanel extends JPanel
A user-triggered collapsible panel.
See Also:
  • Constructor Details

    • CollapsiblePanel

      public CollapsiblePanel(String header, Component contents)
      Constructs a new CollapsiblePanel with the specified header and contents. The panel is initially collapsed by default.
      Parameters:
      header - the header text for the panel
      contents - the component to be shown/hidden when the panel is expanded/collapsed
    • CollapsiblePanel

      public CollapsiblePanel(String header, Component contents, boolean collapsedState)
      Default constructor.
      Parameters:
      header - the label for the collapsible button (Implemented as a checkbox)
      contents - the Component to be collapsed (typically a JPanel)
      collapsedState - Whether contents should be displayed collapsed by default.
  • Method Details

    • setCollapsed

      public void setCollapsed(boolean collapse)
      Sets the collapsed state of this panel.
      Parameters:
      collapse - true to collapse the panel, false to expand it
    • isCollapsed

      public boolean isCollapsed()
      Checks if this panel is currently collapsed.
      Returns:
      true if the panel is collapsed, false if expanded
    • setTooltipText

      public void setTooltipText(String text)