Java >
Guidelines Home Page >  Java Look and Feel Design Guidelines
>
Part III: The Components of the Java Foundation Classes
> 10: Basic Controls >
Sliders
  Previous Next Contents/Index/Search


Sliders

A slider is a control that is used to select a value from a continuous or discontinuous range. The position of the indicator reflects the current value. Major tick marks indicate large divisions along the range of values (for instance, every ten units); minor tick marks indicate smaller divisions (for instance, every five units).

The default slider in the Java look and feel is a nonfilling slider. An example is a slider that adjusts left-right balance in a stereo speaker system, as shown in the following figure.

Figure 167   Nonfilling Slider

 

Nonfilling Slider

A filling slider is also available. The filled portion of the channel, shown in the following figure, represents the range of values below the current value--in this case, the percentage of a paycheck allotted to a retirement savings plan.

Figure 168   Filling Slider

 

Filling Slider

Users can drag the indicator to set a specific value or click the channel to move back and forth by one unit. Sliders can represent a series of discrete values, in which case the indicator snaps to the value closest to the end point of the drag operation.

For a list of keyboard operations for sliders, see Table 24.

  If the slider represents a continuous range or a large number of discrete values and the exact value that is chosen is important, provide a text field where the chosen value can be displayed. For instance, a user might want to specify an annual retirement savings contribution of 2.35%. In such a situation, consider making the text field editable to give users the option of typing in the value directly. Be sure to link the slider and the text field so that each is automatically updated when the user alters the other.

  The JSlider.isFilled client property can be used to enable the optional filling slider.


Java Look and Feel Design Guidelines, second edition.
Copyright 2001. Sun Microsystems, Inc. All Rights Reserved.
Previous Next Contents/Index/Search
Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve
JavaOne Banner
Java 8 banner (182)