value = new Scrollbar(Scrollbar.HORIZONTAL, defaultValue, 1, min, max + 1);
value = new JScrollBar(JScrollBar.HORIZONTAL, defaultValue, 1, min, max + 1);
    public Slider(JFrame parent, String title, String question, int defaultValue, int min, int max) {        super(parent, title, true);        super.setResizable(false);        value = new Scrollbar(Scrollbar.HORIZONTAL, defaultValue, 1, min, max + 1);        value.addAdjustmentListener(this);        getContentPane().setLayout(new BorderLayout());        JPanel qp = new JPanel();        qp.setLayout(new BorderLayout());        lblText.setText(question);        qp.add(lblText, BorderLayout.NORTH);        getContentPane().add(qp, BorderLayout.NORTH);        JPanel sp1 = new JPanel();        sp1.setLayout(new FlowLayout());        minText.setText(String.valueOf(min));        maxText.setText(String.valueOf(max));        curText.setText(String.valueOf(defaultValue));        sp1.add(minText);        sp1.add(value);        sp1.add(maxText);        sp1.add(curText);        getContentPane().add(sp1, BorderLayout.CENTER);        JPanel p = new JPanel();        p.setLayout(new FlowLayout());        butOk.addActionListener(this);        p.add(butOk);        butCancel.addActionListener(this);        p.add(butCancel);        getContentPane().add(p, BorderLayout.SOUTH);        pack();        setLocation(parent.getLocation().x + parent.getSize().width / 2 - getSize().width / 2,                parent.getLocation().y + parent.getSize().height / 2 - getSize().height / 2);    }