Class | Description |
---|---|
ComboListener |
ComboListener listens to changes to the ComboSlider and updates a label
in the display accordingly.
|
Main |
Demonstration.
|
This package provides a demonstration of the use of a ComboSlider.
Run the main program to experience an interactive display using a ComboSlider.
The most common use of a ComboSlider is likely to be in a dialog, where the user adjusts the slider but the result is not needed until the dialog is terminated (for example, by clicking an OK button). For that scenario, the program need only poll the combo slider's getValue() method when the dialog terminates.
In contrast, the example shown here watches the combo slider continuously. An instance of the ComboListener class listens for changes to the combo slider's value and updates the bottom label in the display accordingly. The code to attach the ComboListener can be found in the constructor of the Main class.
The display includes text fields that let you modify the allowed range of the combo slider, and a text label whose text updates to reflect the combo slider's current value. Things to try include: