static double relativeSliderValue(JSlider slider) swing { if (slider == null) ret 0.0; int min = slider.getMinimum(); int max = slider.getMaximum(); int val = slider.getValue(); ret doubleRatio(val-min, max-min); }