title: JavaFX, MediaPlayer - volume trouble! Why the volume of mediaPlayer do not changing bit by bit?
body: <p>I setVolume to 0.0, and then change the volume bit by bit in the while loop. Yet, the volume jumps from 0.0 to 1.0 ? How can I change the volume smoothly?
  I tried</p>
  
  <pre><code>public class EngineSound extends Application {
  
      public static void main(String[] args) {
          launch(args);
      }
  
      @Override
      public void start(Stage primaryStage) throws Exception {
          mp3File = new File(metronom);
          media = new Media(mp3File.toURI().toURL().toString());
          mediaPlayer = new MediaPlayer(media);
          mediaView = new MediaView(mediaPlayer);
          mediaPlayer.play();
          mediaPlayer.setVolume(0.0);
          slider = new Slider();
  
          slider.valueProperty().addListener(new ChangeListener&lt;Number&gt;() {
              public void changed(ObservableValue&lt;? extends Number&gt; ov, Number old_val, Number new_val) {
                  EventQueue.invokeLater(new Runnable() {
  
                      @Override
                      public void run() {
                          mediaPlayer.setVolume(slider.getValue());
  
                      }
                  });
              }
          });
  
          double count = 1;
          while (count != 101) {
              for (int i = 0; i &lt; 100000000; i++) {
  
              }
              slider.setValue(count / 100);
              count++;
              System.out.println(mediaPlayer.getVolume());
          }
      }
  }
  </code></pre>