Search
Accordion Class
Remarks See Also
 






A container control that displays a stack of collapsible panes.

Namespace: com.mindfusion.common
Package: com.mindfusion.common

 Syntax

Java  Copy Code

public class Accordion extends JPanel

 Remarks

The Accordion control organizes its child panels vertically and provides a flexible space-distribution model tailored for sidebars, toolbox panels, and palettes.

Pane Management

Panes can be added using the addPane method, which automatically instantiates and adds a new AccordionPane with a specified title, icon, and content component. Individual panes can be removed from the container by passing the pane instance to the remove method, and the entire stack can be cleared at once using removeAll.

Layout

Only expanded panes are allowed to stretch and share any extra vertical space provided by the parent container. Collapsed panes restrict their maximum height to display only their header buttons. All panes are aligned to the top of the container. If all panes are collapsed, they will stack tightly at the top of the viewport, leaving any remaining empty space at the bottom rather than stretching the collapsed headers to fill the area.

Expansion Management

The control can be configured to either allow multiple panes to be expanded concurrently (the default behavior) or to enforce a single-expand mode where opening one pane automatically collapses all others. This is controlled via the AllowMultipleExpands property. The expansion state of an individual pane can be programmatically queried or updated using the isExpanded and setExpanded methods on the AccordionPane, which fires property change events to allow listeners to react to visibility changes.

 Inheritance Hierarchy

java.lang.Object
    java.awt.Component
        java.awt.Container
            javax.swing.JComponent
                javax.swing.JPanel
                    com.mindfusion.common.Accordion

 See Also