I want to try using the JSlider as a volume control, but don't quite know how to continue.
public void stateChanged(ChangeEvent e) { //Main.mii_floatControl.setValue(20f * (float) Math.log10(Main.slider.getValue()) / 10); Main.mii_floatControl.setValue(Main.slider.getValue() / 10); System.out.println("" + Main.mii_floatControl.getValue()); }
I've tried quite a bit, when converting for Main.mii_floatControl.setValue() to have a suitable value calculated, but neither the volume is changed, nor do I know the correct formula for it. Maybe I have to do it completely differently?
But if it is done very differently, an example would be very helpful