public void updateVolume(int currentVolume){
  if (Math.abs(currentVolume - volume) > 20) {
    volume=currentVolume;
    slm.setValue(volume);
  }
}

public void updateVolume ( int currentVolume ) { if ( Math . abs ( currentVolume - volume ) > 20 ) { volume = currentVolume ; slm . setValue ( volume ) ; } }
updates the volume value in the meter .
