JavaFX graphics bug with ProgressBar and slider
•
Java
I am writing a small application (audio player with function);
This is the 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 the new track covers the old figure, it disappears
Who can help me?
Solution
I solved the problem I had to call the new JavaFX thread from the JavaFX thread;
Platform.runLater(new Runnable(){......});
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码