Code example for JSlider

Methods: getValue

0
     */ 
    private void setSliderBasedPosition() { 
        if(!mediaPlayer.isSeekable()) {
            return; 
        } 
        float positionValue = positionSlider.getValue() / 1000.0f;
        // Avoid end of file freeze-up 
        if(positionValue > 0.99f) {
            positionValue = 0.99f;
        } 
        mediaPlayer.setPosition(positionValue);
    } 
 
    private void updateUIState() { 
        if(!mediaPlayer.isPlaying()) {
            // Resume play or play a few frames then pause to show current position in video 
            mediaPlayer.play();
            if(!mousePressedPlaying) {
                try { 
                    // Half a second probably gets an iframe