Chapter 7. Lists, Combo Boxes, and Spinners

This chapter deals with three similar components: lists, combo boxes, and spinners. All three present a catalog of choices to the user. A list allows the user to make single or multiple selections. A combo box permits only a single selection but can be combined with a text field that allows the user to type in a value as well. From a design standpoint, both lists and combo boxes share similar characteristics, and both can be extended in ways that many Swing components cannot. SDK 1.4 introduced spinners, which are compact components that allow you to click or “spin” through a set of choices one at a time.

Get Java Swing, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.