import java.awt.*;
import javax.swing.*;


/**
 * An example that uses a slider
 *
 * @author  Prof. David Bernstein, James Madison Univeristy
 * @version 1.0
 */
public class SliderDriver
{

    /**
     * The entry point of the example
     *
     * @param args   The command line arguments
     */
    public static void main(String[] args)
    {
        Container   contentPane;
	JFrame      frame;
        JSlider     slider;
        JLabel      titleLabel;

        frame = new JFrame("A Really Amazing Window!");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        // Get the content pane
        contentPane = frame.getContentPane();
        contentPane.setLayout(null);

        // Construct the widgets/components
        titleLabel   = new JLabel("A Slider Example");
        slider       = new JSlider(0, 100, 50);

        // Layout the content pane
        contentPane.add(titleLabel);
        titleLabel.setBounds(60,20,290,30);

        contentPane.add(slider);
        slider.setBounds(60,100,290,30);

        // Setup the observer
        SliderHandler handler = new SliderHandler(titleLabel);
        slider.addChangeListener(handler);
        
	frame.setSize(400,400);
	frame.setVisible(true);
    }
}
