I am writing a small application (Audio player with features); I use slider and progress bar to show a progress of current track. But When track is changed a progressBar and Slider take old position (with random chance);
Here is a code of fxml:
<StackPane layoutY="64.0" prefHeight="20.0" prefWidth="492.0" AnchorPane.leftAnchor="26.0" AnchorPane.rightAnchor="24.0">
<children>
<ProgressBar id="progress" fx:id="progressBar" cache="true" cacheHint="QUALITY" disable="true" maxHeight="-1.0" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" opacity="1.0" prefHeight="9.0" prefWidth="-1.0" progress="0.0" />
<Slider fx:id="progressSlider" disable="false" opacity="1.0" value="0.0" />
</children>
</StackPane>
when new track overrides the old graphic, it gone.
Can anybody help me?
I solved this issue. I had to call new JavaFX thread from JavaFX thread;
Platform.runLater(new Runnable(){......});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With