Code example for JSlider

Methods: setOpaqueaddChangeListener

0
    { 
        super(new BorderLayout(5, 5));
        setOpaque(false);
        add(_label = new JLabel(), BorderLayout.WEST);
        setLabel(label);
        add(_slider = new JSlider(min, max, value), BorderLayout.CENTER);
        _slider.setOpaque(false);
        _slider.addChangeListener(this);
        add(_value = new JLabel(Integer.toString(value)), BorderLayout.EAST);
    } 
 
    /** 
     * Returns the slider component. 
     */ 
    public JSlider getSlider ()
    { 
        return _slider;
    } 
 
    // documentation inherited 
Connect your IDE to all the code out there  Get Codota for Java