Components that use the bounded-range model typically consist of an integer value that is constrained within two integer boundaries. The lower boundary, the minimum , should always be less than or equal to the model’s current value. In addition, the model’s value should always be less than the upper boundary, the maximum. The model’s value can cover more than one unit; this size is referred to as its extent . With bounded range, the user is allowed to adjust the value of the model according to the rules of the component. If the value violates any of the rules, the model can adjust the values accordingly.
javax.swing.BoundedRangeModel interface outlines the data model for such an object.
Objects implementing the
BoundedRangeModel interface must contain an
adjustable integer value, an extent, a minimum, and a maximum. Swing
contains three bounded-range components:
JProgressBar. These components are shown in
Figure 6-1. Bounded-range components in Swing
Table 6-1 shows the
properties of the
Table 6-1. BoundedRangeModel properties
value properties form the actual
bounded range. The
property can give the value its ...