Java Reference
In-Depth Information
16.27
How do you create an observable list with an array of strings?
Check
16.28
How do you set the orientation in a list view?
Point
16.29
What selection modes are available for a list view? What is the default selection
mode? How do you set a selection mode?
16.30
How do you obtain the selected items and selected indices?
16.10 ScrollBar
ScrollBar is a control that enables the user to select from a range of values.
Key
Point
Figure 16.21 shows a scroll bar. Normally, the user changes the value of a scroll bar by mak-
ing a gesture with the mouse. For example, the user can drag the scroll bar's thumb, click on
the scroll bar track, or the scroll bar's left or right buttons.
Minimal value
Maximal value
Track
Thumb
Left button
Right button
F IGURE 16.21
A scroll bar represents a range of values graphically.
ScrollBar has the following properties, as shown in Figure 16.22.
The getter and setter methods for property
values and a getter for property itself are provided
in the class, but omitted in the UML diagram for brevity.
javafx.scene.control.ScrollBar
-blockIncrement: DoubleProperty
-max: DoubleProperty
-min: DoubleProperty
-unitIncrement: DoubleProperty
The amount to adjust the scroll bar if the track of the bar is clicked (default: 10 ).
The maximum value represented by this scroll bar (default: 100 ).
The minimum value represented by this scroll bar (default: 0 ).
The amount to adjust the scroll bar when the increment() and decrement()
methods are called (default: 1 ).
Current value of the scroll bar (default: 0 ).
The width of the scroll bar (default: 15 ).
Specifies the orientation of the scroll bar (default: HORIZONTAL ).
-value: DoubleProperty
-visibleAmount: DoubleProperty
-orientation: ObjectProperty<Orientation>
+ScrollBar()
+increment()
+decrement()
Creates a default horizontal scroll bar.
Increments the value of the scroll bar by unitIncrement .
Decrements the value of the scroll bar by unitIncrement .
F IGURE 16.22
ScrollBar enables the user to select from a range of values.
Note
The width of the scroll bar's track corresponds to max + visibleAmount . When a
scroll bar is set to its maximum value, the left side of the bubble is at max , and the right
side is at max + visibleAmount .
 
 
 
Search WWH ::




Custom Search