Skip to main content

Overview

JAccordion is a themed wrapper around JavaFX’s Accordion control. It provides a container for multiple JAccordionPane components, allowing only one pane to be expanded at a time.

Constructor

JAccordion()
constructor
Creates an empty accordion.
JAccordion(TitledPane... panes)
constructor
Creates an accordion with the specified panes.

Inherited Methods

As JAccordion extends JavaFX’s Accordion, it inherits all standard accordion functionality:
getPanes()
ObservableList<TitledPane>
Returns the observable list of panes in the accordion.
setExpandedPane(TitledPane pane)
void
Sets the currently expanded pane.
getExpandedPane()
TitledPane
Gets the currently expanded pane.
expandedPaneProperty()
ObjectProperty<TitledPane>
Property representing the currently expanded pane.

Style Classes

j-accordion
String
Base style class applied to the accordion container

Example Usage

// Create accordion with panes
JAccordion accordion = new JAccordion();

// Add panes
accordion.getPanes().addAll(
    new JAccordionPane("Section 1", new Label("Content 1")),
    new JAccordionPane("Section 2", new Label("Content 2")),
    new JAccordionPane("Section 3", new Label("Content 3"))
);

// Set initially expanded pane
accordion.setExpandedPane(accordion.getPanes().get(0));

// Using constructor
JAccordion accordion = new JAccordion(
    new JAccordionPane("Section 1", new Label("Content 1")),
    new JAccordionPane("Section 2", new Label("Content 2"))
);

Source

com.jjarroyo.components.JAccordion in JAccordion.java:6

Build docs developers (and LLMs) love