コード例 #1
0
 public void animate() {
   Timeline timeline =
       new Timeline(
           new KeyFrame(
               Duration.seconds(0),
               new KeyValue(translateZ.zProperty(), -20),
               new KeyValue(rotateX.angleProperty(), 90),
               new KeyValue(rotateY.angleProperty(), 90),
               new KeyValue(rotateZ.angleProperty(), 90)),
           new KeyFrame(
               Duration.seconds(5),
               new KeyValue(translateZ.zProperty(), -80),
               new KeyValue(rotateX.angleProperty(), -90),
               new KeyValue(rotateY.angleProperty(), -90),
               new KeyValue(rotateZ.angleProperty(), -90)));
   timeline.setCycleCount(Animation.INDEFINITE);
   timeline.play();
 }