List of usage examples for javafx.animation StrokeTransition StrokeTransition
public StrokeTransition(Duration duration, Shape shape, Color fromValue, Color toValue)
From source file:Main.java
@Override public void start(Stage primaryStage) { Group group = new Group(); Rectangle rect = new Rectangle(20, 20, 200, 200); StrokeTransition sT = new StrokeTransition(Duration.millis(2000), rect, Color.LIME, Color.YELLOW); sT.play();/* w w w .j av a 2 s . com*/ group.getChildren().add(rect); Scene scene = new Scene(group, 300, 200); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { final Group group = new Group(); Scene scene = new Scene(group, 300, 150); stage.setScene(scene);/*from w w w . j a v a 2 s.c o m*/ stage.setTitle("Sample"); Rectangle rect = new Rectangle(100, 40, 100, 100); rect.setArcHeight(50); rect.setArcWidth(50); rect.setFill(null); StrokeTransition st = new StrokeTransition(Duration.millis(3000), rect, Color.RED, Color.BLUE); st.setAutoReverse(true); st.play(); group.getChildren().add(rect); stage.show(); }