package com.example.demo1;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Ellipse;
import javafx.scene.shape.Line;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
public class Snowman extends Application {
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.setRotate(15);
hat.setTranslateX(10);
Group snowman= new
Group(base,middle,head,leftarm,rightarm,lefteye,Righteye,mouth,topbutton,bottombutton,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,snowman,sun);
Scene scene = new Scene(root,500,350,Color.LIGHTBLUE);
PrimaryStage.setScene(scene);
PrimaryStage.setTitle("Snowman");
PrimaryStage.show();
}
public static void main(String[] args) {
launch();
}
}