title: How to have two sliders?
body: <p>How do I go about adding in another slider with an output? I want the slider just below the current one. So currently I have one slider working and just want to add another one. Do i need to add another panel or..?</p>
  
  <pre><code>public class Lab6Part3 extends JFrame implements ChangeListener {
  
  JSlider slider = new JSlider();
  JLabel outputLabel = new JLabel("Volume");
  
  public Lab6Part3(){
  
      slider.setMaximum(30);
      slider.setMinimum(0);
  
      slider.addChangeListener(this);
  
      getContentPane().add(outputLabel);
      getContentPane().add(slider, BorderLayout.NORTH);
      setSize(300,200);
      setVisible(true);
  }
  public static void main (String[] args){
      new Lab6Part3();
  }
  public void stateChanged(ChangeEvent e){
      outputLabel.setText("Volume:  " + slider.getValue());
  }
  
  }
  </code></pre>