During your journey through the Java language, your best friend will become the API. This is one of those questions that is really easy to answer, but also where the API could have saved you a little bit of time waiting here for an answer. If you look at the link above, you will notice that JSlider can take a min int and a max int in its constructor. You can also use the setMinimum(int) and setMaximum(int) methods to do the same thing. Of course, that adds 2 lines of code to your program. I am usually all about as little code as possible.