The color selection sample changes the RGB value and selects the color using the slider and spin button.
The color selection sample uses the following classes:
JFSlider
JFFieldLong
JFSpinButton
JFGroupbox
JFPanel
Figure 1.29 Color selection sample
Operation method
Sample
Displays the color specified with the slider or spin button.
Slider operation panel
Operating the slider control using the mouse or keyboard displays the color corresponding to the slider position (value) and displays the value on the spin button operation panel.
Spin button operation panel
Operating the spin button arrow using the mouse or keyboard changes the value and displays the color corresponding to the changed value on the sample. The operations of the spin button and slider are linked; therefore, the slider control changes in accordance with the spin button operation. Data can be entered in the section displaying the numeric value. The value can also be specified directly. The specifiable range is between 0 to 255.
Source codes
Color selection sample:"Sample Storage Destinations"/common/ColorSelector.java