Class JSlider

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   go to next page

Answer:

The add() method, as with any component.

Class JSlider

vertical slider

The pictures show a variety of sliders. Sliders may be oriented horizontally or vertically. The tick marks and labels are part of the slider. These may be displayed, or not, as an option.

horizontal slider horizontal slider

Click on and drag the knob to adjust values. As you drag the knob, ChangeEvents are generated.

QUESTION 2:

(Take a Guess: ) What type of listener responds to a ChangeEvent?