public void stateChanged(ChangeEvent e) { JSlider sliderCutoff = (JSlider) e.getSource(); int cutoff = (int) sliderCutoff.getValue(); filter.setCutoff((double) cutoff / 4000.0d); }
public void stateChanged(ChangeEvent e) { JSlider sliderResonance = (JSlider) e.getSource(); int ripple = (int) sliderResonance.getValue(); filter.setRipple((double) ripple / 2.0d); }
public void actionPerformed(ActionEvent e) { String actionCommand = e.getActionCommand(); if (actionCommand == "Low-pass") filter.setLowpass(true); else if (actionCommand == "High-pass") filter.setLowpass(false); }