public void start(Stage primaryStage) {         // create a rectangle with width 50, height 80 and color blue ………………………………………………………………………………………………………………………………………………………………………………………………………………         // create the transition ………………………………………………………………………………………………………………………………………………………………………………………………………………         // set the duration of the transition as 5 seconds ………………………………………………………………………………………………………………………………………………………………………………………………………………         // make the rectangle as the node for the transition ………………………………………………………………………………………………………………………………………………………………………………………………………………         // transition to double the size of x ………………………………………………………………………………………………………………………………………………………………………………………………………………             // transition to double the size of y ………………………………………………………………………………………………………………………………………………………………………………………………………………         // set the cycle count as 2 ………………………………………………………………………………………………………………………………………………………………………………………………………………         // set it so the transition will reverse ………………………………………………………………………………………………………………………………………………………………………………………………………………         // play the transition ………………………………………………………………………………………………………………………………………………………………………………………………………………           StackPane root = new StackPane();         root.getChildren().add(rectangle);         Scene scene = new Scene(root, 300, 250);         primaryStage.setTitle("Animating a Rectangle");         primaryStage.setScene(scene);         primaryStage.show();     } }

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 6RQ
icon
Related questions
Question

Complete this code to have the following rectangle:

 

public void start(Stage primaryStage) {

        // create a rectangle with width 50, height 80 and color blue

………………………………………………………………………………………………………………………………………………………………………………………………………………

        // create the transition

………………………………………………………………………………………………………………………………………………………………………………………………………………

        // set the duration of the transition as 5 seconds

………………………………………………………………………………………………………………………………………………………………………………………………………………

        // make the rectangle as the node for the transition

………………………………………………………………………………………………………………………………………………………………………………………………………………

        // transition to double the size of x

………………………………………………………………………………………………………………………………………………………………………………………………………………

 

 

        // transition to double the size of y

………………………………………………………………………………………………………………………………………………………………………………………………………………

        // set the cycle count as 2

………………………………………………………………………………………………………………………………………………………………………………………………………………

        // set it so the transition will reverse

………………………………………………………………………………………………………………………………………………………………………………………………………………

        // play the transition

………………………………………………………………………………………………………………………………………………………………………………………………………………

 

        StackPane root = new StackPane();

        root.getChildren().add(rectangle);

        Scene scene = new Scene(root, 300, 250);

        primaryStage.setTitle("Animating a Rectangle");

        primaryStage.setScene(scene);

        primaryStage.show();

    }

}

Animating a Rectangle
Transcribed Image Text:Animating a Rectangle
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Software products
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage