I am trying to show a GIF in a scene on JavaFX, I have it shown on the scene and it plays but it loops back to the beginning before the full GIF is played. The GIF is 216 frames so about 30 seconds long. Is this why it doesn't play the whole thing? Or is there a way to make it play the full thing?
rules.setOnAction(new EventHandler<ActionEvent>() {
@Override public void handle(ActionEvent e) {
Stage rulesWindow = new Stage();
Pane r_2 = new Pane(tutorialView);
Scene sc = new Scene(r_2,width/2,height/2);
rulesWindow.setScene(sc);
tutorialView.setFitWidth(width/2);
tutorialView.setFitHeight(height/2);
rulesWindow.show();
}
});
I instantiated tutorialView
outside the method, so it is not seen in this part of the code.
I can't upload what it plays because the file is too big but if you watch the full GIF it stops where the green circles appear for the first time