sliderModel = new DefaultBoundedRangeModel(value, 0, minimum, maximum); if (orientation != HORIZONTAL && orientation != VERTICAL) throw new IllegalArgumentException(orientation + " is not a legal orientation"); this.orientation = orientation; changeListener = createChangeListener(); sliderModel.addChangeListener(changeListener); updateUI();
this(HORIZONTAL, 0, 100, 50);
  public JSlider(int orientation, int minimum, int maximum, int value)  {    sliderModel = new DefaultBoundedRangeModel(value, 0, minimum, maximum);    if (orientation != HORIZONTAL && orientation != VERTICAL)      throw new IllegalArgumentException(orientation + " is not a legal orientation");    this.orientation = orientation;    changeListener = createChangeListener();    sliderModel.addChangeListener(changeListener);    updateUI();  }