Class FadeTransition

java.lang.Object

public final class FadeTransition extends Transition
This Transition creates a fade effect animation that spans its duration. This is done by updating the opacity variable of the node at regular intervals.

It starts from the fromValue if provided else uses the node's opacity value.

It stops at the toValue value if provided else it will use start value plus byValue.

The toValue takes precedence if both toValue and byValue are specified.

Code Segment Example:

 
 import javafx.scene.shape.*;
 import javafx.animation.*;

 ...

     Rectangle rect = new Rectangle (100, 40, 100, 100);
     rect.setArcHeight(50);
     rect.setArcWidth(50);
     rect.setFill(Color.VIOLET);

     FadeTransition ft = new FadeTransition(Duration.millis(3000), rect);
     ft.setFromValue(1.0);
     ft.setToValue(0.3);
     ft.setCycleCount(4);
     ft.setAutoReverse(true);

     ft.play();

 ...

 
 
Since:
JavaFX 2.0
See Also: