import javafx.animation.*; import javafx.application.*; import javafx.scene.*; import javafx.scene.control.*; import javafx.scene.layout.*; import javafx.stage.Stage; import javafx.util.*; public class RT17191 extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) { StackPane root = new StackPane(); Scene scene = new Scene(root); final Label label = new Label("Fading..."); new Timeline(new KeyFrame(Duration.ZERO, new KeyValue(label.opacityProperty(), 1)), new KeyFrame(Duration.millis(10000), new KeyValue(label.opacityProperty(), 0))).play(); root.getChildren().add(label); stage.setWidth(200); stage.setHeight(200); stage.setScene(scene); stage.centerOnScreen(); stage.show(); } }