-
Book Overview & Buying
-
Table Of Contents
JavaFX 1.2 Application Development Cookbook
By :
We have seen how to capture data input using traditional GUI controls such as TextBoxes and Buttons. The Slider control offers a different means of inputting data by sliding a knob along a groove. In this recipe, we use the Slider control to create a color picker application.
The Slider control is part of the standard GUI controls offered by JavaFX in the javafx.scene.control package. By sliding the slider along its track, users are both inputting data by selecting the slider's position on the track, and they are getting visual feedback confirming their input. If you have not used the JavaFX controls, it may be helpful to review the recipe Creating a form with JavaFX controls for some background information.
The following code snippet shows you how to use the Slider control as an input controller to update the color values of another object on the stage. You can get the full code listing from ch04/source-code...
Change the font size
Change margin width
Change background colour