Home » JavaFX Pause Transition

JavaFX Pause Transition

by Online Tutorials Library

JavaFX Pause Transition

As the name suggests, this transition is used to pause between the multiple animations applied on a node in the sequential order. During the lifespan of this transition, the node remains unmovable on the screen.

In JavaFX, the class javafx.animation.PauseTransition represents this transition. We just need to instantiate this class in order to create an appropriate Pause Transition.

Properties

Property Description Setter Methods
duration It is a type of object of the class Duration. It represents the lifespan of the transition. setDuration(Duration duration)

Constructors

There are two constructors in the class.

  1. public PauseTransition() : Creates the new instance of PauseTransition with the default parameters.
  2. public PauseTransition(Duration duration) : Creates the new instance of PauseTransition with the specified duration.

Example

In the following example, we have applied multiple animations on a polygon. We have given the pause of 1 sec to the node after each transition.

Output:

JavaFX Pause Transition

You may also like