Example usage for javafx.animation TranslateTransition setCycleCount

List of usage examples for javafx.animation TranslateTransition setCycleCount

Introduction

In this page you can find the example usage for javafx.animation TranslateTransition setCycleCount.

Prototype

public final void setCycleCount(int value) 

Source Link

Usage

From source file:com.loyalty.controllers.DashboardController.java

private void animate() {
    Toolkit tk = Toolkit.getDefaultToolkit();
    Dimension screenDimension = tk.getScreenSize();
    TranslateTransition transition = new TranslateTransition(new Duration(30000), lbl_promotion);
    transition.setInterpolator(Interpolator.LINEAR);
    transition.setCycleCount(Timeline.INDEFINITE);
    transition.setFromX(screenDimension.getWidth());
    transition.setToX(-screenDimension.getWidth());
    transition.play();//from  w w w. j a v a  2  s  .  c  om
}