Scratch for Java

Slider()

A value between a smallest and a largest one, e.g. a volume: left and right change it in steps while it has the focus, the mouse sets it by clicking or dragging along the bar. Override whenChanged(double) with what it sets.

Slider music = new Slider("Music", 0, 100, window.getMusicVolume()) {
  public void whenChanged(double value) {
    Window.getInstance().setMusicVolume(value);
  }
};

Examples

View on GitHub

Syntax

Java

new Slider(text, min, max, value)
Slider()

Create Shareable URL

Select Sections