title: JSlider throwing illegalArgument exception:invalid range properties
body: <p>I have a simple panel with a JSlider and 3 jtextfields.
  I am constructing a JSlider using the constructor JSlider(int min, int max, int value)
  like this :</p>
  
  <pre><code>public class Slide extends JFrame{
  
      JSlider slider=new JSlider(100,200,50);//here lies the problem
      JTextField maxVal=new JTextField(10);
      JTextField minVal=new JTextField(10);
      JTextField curVal=new JTextField(10);
      public Slide(){
  
  
          JPanel panel=new JPanel();
          slider.addChangeListener(new ChangeListener() {
              public void stateChanged(ChangeEvent arg0) {
                  minVal.setText(slider.getMinimum()+"");
                  maxVal.setText(slider.getMaximum()+"");
                  curVal.setText(slider.getValue()+"");
  
              }
          });
          panel.setLayout(new MigLayout("", "[][][][]", "[][][][]"));
  
  
  
          panel.add(slider, "cell 0 0,alignx left,aligny top");
          JLabel label = new JLabel("Min val");
          panel.add(label,"cell 0 2");
          panel.add(minVal, "cell 3 2");
          this.setContentPane(panel);
          JLabel label_1 = new JLabel("Max val:");
          panel.add(maxVal,"cell 3 3");
          panel.add(label_1, "cell 0 3");
          panel.add(new JLabel("Cur value:"), "cell 0 4");
          panel.add((curVal),"cell 3 4");
          this.setSize(400, 400);
          this.setVisible(true);
          this.setDefaultCloseOperation(EXIT_ON_CLOSE);
      }
  
      public static void main(String args[]){
          new Slide();
      }
  }
  </code></pre>
  
  <p>The problem is that when I try to run this program I get an illegal argument exception but if i remove the third argument everything is ok.</p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalArgumentException: invalid range properties
      at javax.swing.DefaultBoundedRangeModel.&lt;init&gt;(DefaultBoundedRangeModel.java:102)
      at javax.swing.JSlider.&lt;init&gt;(JSlider.java:274)
      at javax.swing.JSlider.&lt;init&gt;(JSlider.java:241)
      at JSlider.Slide.&lt;init&gt;(Slide.java:20)
      at JSlider.Slide.main(Slide.java:54)
  Java Result: 1
  </code></pre>
  
  <p>Any ideas why this is happening?</p>