Question: B7. Analyze the following JavaFX program and complete the missing code based on the comments: [10 marks] Animation Demo import javafx.scene. shape. Rectangle; import javafx.scene.shape.Circle;
B7. Analyze the following JavaFX program and complete the missing code based on the comments: [10 marks] Animation Demo import javafx.scene. shape. Rectangle; import javafx.scene.shape.Circle; import javafx.scene.paint.Color; import javafx.animation.PathTransition; import javafx.animation. Timeline; import javafx.util.Duration; Rectangle rectangle = new Rectangle(0, 0, 25, 50); rectangle. setFill (Color. ORANGE); Circle circle = new Circle (125,100,50); circle. setFill (Color.WHITE); circle.setStroke (Color.BLACK); pane.getChildren() .addAll(circle, rectangle); // Create a path transition pt = // Set the circle as the path of the animation // Set the rectangle as the node of the animation // Set the transition duration to 5 seconds // Make the animation continues forever (set the cycle count) // Make the animation's direction moves reversed in the // alternating cycle (set the auto reverse) // Start the animation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
