Summary
Section 22.2 JSlider
JSliders (p. 2) enable you to select from a range of integer values. They can display major and minor tick marks, and labels for the tick marks (p. 2). They also support snap-to ticks (p. 3)—positioning the thumb (p. 2) between two tick marks snaps it to the closest tick mark.JSliders have either horizontal or vertical orientation. For a horizontalJSlider, the minimum value is at the extreme left and the maximum value at the extreme right. For a verticalJSlider, the minimum value is at the extreme bottom and the maximum value at the extreme top. The position of the thumb indicates the current value of theJSlider. MethodgetValue(p. 6) of classJSliderreturns the current thumb position.JSlidermethodsetMajorTickSpacing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access