JVSliders

You will find here information to use and manipulate the sliders

Contrary to buttons and checkboxes, sliders must be declared in the Pj class. There are a types for each sliders you may want to create. For instance, you can use "PuDouble" for a sliders of double. Then you have to initialize it twice :
m_[name of the slider] = new PuDouble("Step Size:", this);
The slider is now aware that he have to pass the update information with the method "update".

Now you have to announce the slider to your slider panel in the IP class, in the method "setParent", using this line :
m_sliderPanel.add(m_myProject.m_[slider name].getInfoPanel());

Finally, you have access to the value of the slider using the function "getValue" of the slider class, and you can handle an update of the slider state in the method update using this condition :
if(event == m_[name of the slider]) {
    //Do whatever you want
    return super.update(this);
}

Comments