JavaFX Fade Transition
It animates the opacity of the node so that the fill color of the node becomes dull. This can be done by keep decreasing the opacity of the fill color over a specified duration in order to reach a target opacity value.
In JavaFX, the class javafx.animation.FadeTransition represents FadeTransition. We need to instantiate this class in order to create the appropriate Fade Transition.
The properties of the class along with their setter methods are described in the following table.
||It is a double type property. It represents the incremented stop opacity value of the Fade transition.
||This is an object type property of the class Duration. It represent the duration of this fade transition.
||This is a double type property. It represents the start opacity for the fade transition.
||This is an object type property of the class Node. This represents the node onto which, the transition is to be applied.
||This is a double type property. This represents the stop value of the opacity for the fade transition.
The class contains three Constructors.
- public TranslateTransition() : creates the new instance of TranslateTransition with the default parameters.
- public TranslateTransition(Duration duration) : creates the new instance of TranslateTransition with the specified duration.
- public TranslateTransition(Duration duration, Node node) : creates the new instance of Translate Transition with the specified duration and node.
In the following example, the opacity of the color of the circle keeps decreasing from the 10 to 0.1.