Java Reference
In-Depth Information
•
JSpinner
: This component, shown in Figure 1-4, provides selection from an ordered set
of predefined values, offering arrows to scroll through the next and previous choices.
The predefined values can be an array of strings, a sequential set of numbers, or a date.
Figure 1-4.
The Swing JSpinner
•
JToggleButton
: This component offers a button that stays depressed when selected. In
the example shown in Figure 1-5, the North, East, and South buttons are depressed.
Figure 1-5.
The Swing JToggleButton
•
JSlider
: This component is like the
Scrollbar
component of AWT (or
JScrollBar
in the
Swing component set). However, its purpose in Swing is for user input. It offers various
clues to help the user choose a value. Figure 1-6 shows an example of a
JSlider
component.
Figure 1-6.
The Swing JSlider
•
JProgressBar
: This component allows the user to visually see the progress of an activity.
Some options available include showing static text or percentage done, as shown in
Figure 1-7.
Figure 1-7.
The Swing JProgressBar