How-To's > How do I create a carousel?


The carousel widget is a visually attractive way to present a list of options to the user. In the full carousel, the panels rotate in a circle as the user clicks to bring panels to the foreground.

Circular carousel

In the flat carousel, panels slide to the right or left as the user clicks to move forward or backward.

Flat carousel

Use a carousel when the choices are visually distinct, such as images, album art, or web pages. Choosing between a carousel, a flat carousel, and a cover flow is often a matter of what suits your application from an aesthetic point of view.

To create a carousel in JavaFX, start with the code from one of the following samples and modify it to suit your purposes.

Examples

  • An Easy Image Carousel
    In this example of a round carousel, the user clicks the forward or back arrow to rotate the photos around to the foreground.



  • Shopping Mashup
    This example demonstrates a flat carousel, which is used to present user choices in a shopping mashup application.

Related How-To Topics

Last Updated: April 2010
[Return to How-To's Home]