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.

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

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.

- Enhance Your MIDlet With JavaFX Technology
This example uses a carousel of faces for a mobile phone address book. Note that the code is not provided for this example. - 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: November 2009
[Return to How-To's Home]
Do you have comments about this article? We welcome your participation in our community. Please keep your comments civil and on point. You may optionally provide your email address to be notified of repliesyour information is not used for any other purpose. By submitting a comment, you agree to these Terms of Use.