Skip to content

Carousel

Paged carousel container supporting horizontal or vertical card paging, animated slide transitions, navigation buttons, and indicator dots.

Overview

Paged carousel container supporting horizontal or vertical card paging, animated slide transitions, navigation buttons, and indicator dots. Provides extensive layout configuration and interaction capabilities.

Basic Usage

Carousel carousel = new Carousel();
carousel.addPage(slide1).addPage(slide2);
  • PageView: Retained page container that keeps exactly one page visible at a time.

API

Constructs an empty Carousel with default header controls and dot indicators.

Carousel::addPage(Widget)

Appends a slide page to the carousel.

Parameter Type Description
page Widget The page widget.

Returns Carousel: This instance for chaining..

Carousel::dots()

Returns the DotIndicator widget displaying carousel page dots.

Returns DotIndicator: The indicator dots container..

Returns the top header container hosting navigation buttons and indicators.

Returns HBox: The carousel header bar..

Carousel::indicator()

Returns the numeric page indicator label.

Returns Label: The indicator label widget..

Carousel::nextButton()

Returns the navigation button stepping to the next slide.

Returns Button: The associated button component..

Carousel::onSelectionChanged(EventListener)

Registers a listener invoked when the active carousel page changes.

Parameter Type Description
listener EventListener The event listener callback.

Returns EventSubscription: The event subscription handle..

Carousel::pageView()

Returns the internal PageView managing slide presentation.

Returns PageView: The underlying PageView container..

Carousel::pages()

Returns an unmodifiable list of all slide pages in the carousel.

Returns List: An unmodifiable list of page widgets..

Carousel::previousButton()

Returns the navigation button stepping to the previous slide.

Returns Button: The associated button component..

Carousel::selectRelative(int)

Steps the slide index by the specified relative delta.

Parameter Type Description
delta int The relative offset delta.

Returns Carousel: This instance for chaining..

Carousel::selectedIndex()

Returns the index of the currently active slide.

Returns int: The result value..

Carousel::selectedIndex(int)

Switches to the specified slide index and dispatches a selection event.

Parameter Type Description
selectedIndex int The index position.

Returns Carousel: This instance for chaining..

Carousel::silentSelectedIndex(int)

Switches to the specified slide index without triggering event callbacks.

Parameter Type Description
selectedIndex int The index position.

Returns Carousel: This instance for chaining..