javafx every second

Solutions on MaxInterview for javafx every second by the best coders in the world

showing results for - "javafx every second"
Luca
30 Oct 2017
1Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(1), ev -> {
2    //what you want to do
3}));
4timeline.setCycleCount(1);//do it x times
5timeline.setCycleCount(Animation.INDEFINITE);//or indefinitely
6
7//play:
8timeline.play();
9//pause:
10timeline.pause();
11//stop:
12timeline.stop();