-
Class Summary
Class |
Description |
ComboSlider |
ComboSlider implements a combination slider/text field for entering integer
data.
|
Package comboslider Description
This package provides a Swing component for entering an integer value
that combines a linked slider and editable text field.
Introduction
[Description]
ComboSlider creates a Swing control for entry of an integer value.
The control combines a slider with an editable text field, linked so
that the text field shows the current value of the slider, and changing
either one updates the other to match.
Usage
[Description]
Add an instance of ComboSlider to a Swing GUI the same way you
would add an ordinary text field or slider.
-
The constructor requires two integer values, the lower and upper
limits of the range of valid inputs. A default constructor is supplied,
which sets the range to 0-100.
-
Access the field value programmatically via the getValue()
and setValue() methods. You can add a ChangeListener
to the control via the addChangeListener() method.
-
The minimum and maximum values of the input range can be accessed via
getLow() and getHigh() and adjusted via
setLow() and setHigh(). (If the user attempts to
set the lower limit higher than the upper limit, the two limits will
be made equal.)
-
Physical dimensions of the control are hard-coded in the constructor
(but can be edited in the source code as needed).
Related Documentation
[Description]