📜  每秒 javafx - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:22.233000             🧑  作者: Mango

代码示例1
Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(1), ev -> {
    //what you want to do
}));
timeline.setCycleCount(1);//do it x times
timeline.setCycleCount(Animation.INDEFINITE);//or indefinitely

//play:
timeline.play();
//pause:
timeline.pause();
//stop:
timeline.stop();