The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Trail: Creating a GUI with JFC/Swing
Lesson: Using Swing Components

How to Use Spinners

In release 1.4, a new Swing component called the spinner was introduced. Spinners are similar to combo boxes(in the Creating a GUI with JFC/Swing trail) and lists(in the Creating a GUI with JFC/Swing trail) in that they let the user choose one from a range of values. Like editable combo boxes, spinners can allow the user to type in a value. Unlike combo boxes and lists, however, spinners force users to select values in a particular order. Except for the case where the user types in a value, the user must step through the possible values (using onscreen arrow buttons or the keyboard's arrow keys) one at a time, in a predefined sequence.

Here are some examples of spinners from various look and feels:

Windows spinner CDE/Motif spinner Java look and feel spinner Mac Acqua spinner
Windows CDE/Motif JLF Mac Aqua

[PENDING: One day, this page will tell you how to use spinners, with examples and tables of the spinner API. Until then, you can find information about spinners from JSpinner - A Simple Sequence Container(outside of the tutorial), which is part of the J2SE v 1.4 release notes.]


Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Copyright 1995-2002 Sun Microsystems, Inc. All rights reserved.