Java Swing How to - Make the horizontal slider move right-to-left








Question

We would like to know how to make the horizontal slider move right-to-left.

Answer

//from w ww  . jav  a 2 s.com
import javax.swing.JSlider;

public class Main {
  public static void main(String[] argv) throws Exception {
    JSlider slider = new JSlider();

    slider.setInverted(true);

  }
}