Question: changes needed is at the end of the code //************************************************************************ // Snowman.java Author: Lewis/Loftus // // Demonstrates the translation of a set of shapes. //************************************************************************

changes needed is at the end of the code

//************************************************************************

// Snowman.java Author: Lewis/Loftus

//

// Demonstrates the translation of a set of shapes.

//************************************************************************

import javafx.application.Application;

import javafx.stage.Stage;

import javafx.scene.Group;

import javafx.scene.Scene;

import javafx.scene.paint.Color;

import javafx.scene.shape.*;

public class Snowman extends Application

{

//--------------------------------------------------------------------

// Presents a snowman scene.

//--------------------------------------------------------------------

public void start(Stage primaryStage)

{

Ellipse base = new Ellipse(80, 210, 80, 60);

base.setFill(Color.WHITE);

Ellipse middle = new Ellipse(80, 130, 50, 40);

middle.setFill(Color.WHITE);

Circle head = new Circle(80, 70, 30);

head.setFill(Color.WHITE);

Circle rightEye = new Circle(70, 60, 5);

Circle leftEye = new Circle(90, 60, 5);

Line mouth = new Line(70, 80, 90, 80);

Circle topButton = new Circle(80, 120, 6);

topButton.setFill(Color.RED);

Circle bottomButton = new Circle(80, 140, 6);

bottomButton.setFill(Color.RED);

Line leftArm = new Line(110, 130, 160, 130);

leftArm.setStrokeWidth(3);

Line rightArm = new Line(50, 130, 0, 100);

rightArm.setStrokeWidth(3);

Rectangle stovepipe = new Rectangle(60, 0, 40, 50);

Rectangle brim = new Rectangle(50, 45, 60, 5);

Group hat = new Group(stovepipe, brim);

hat.setTranslateX(10);

hat.setRotate(15);

Group snowman = new Group(base, middle, head, leftEye, rightEye,

mouth, topButton, bottomButton, leftArm, rightArm, hat);

snowman.setTranslateX(170);

snowman.setTranslateY(50);

Circle sun = new Circle(50, 50, 30);

sun.setFill(Color.GOLD);

Rectangle ground = new Rectangle(0, 250, 500, 100);

ground.setFill(Color.STEELBLUE);

Group root = new Group(ground, sun, snowman);

Scene scene = new Scene(root, 500, 350, Color.LIGHTBLUE);

primaryStage.setTitle("Snowman");

primaryStage.setScene(scene);

primaryStage.show();

}

public static void main(String[] args)

{

launch(args);

}

}

____________________________________________________

above is the code and i need to do some changes:

a) Add a third red button to the upper torso b) Give the snowman a mouth instead of of the line he has now (you will need to use the JavaFX Ellipse class to create the smile) c) Move the sun to the upper-right corner of the picture d) Display your name in the upper-left corner of the picture e) Shift the snowman 20 pixels to the right

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!