Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am trying to run my Java program in eclipse but it wopackage Shapes; / / imported the required packages import javafx.application.Application; import javafx.geometry.Insets; import

I am trying to run my Java program in eclipse but it wopackage Shapes;
//imported the required packages
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.Group;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.StackPane;
import javafx.scene.shape.Line;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Rectangle;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
//
public class Shape extends Application {
//defining the X variable
private static final int x =50;
public static void launch(String[] args){
launch(args);
}
@Override
public void start(Stage primaryStage)
throws Exception {
//created rectangle
//set properties
Rectangle rect = new Rectangle();
rect.setX(50);
rect.setY(50);
rect.setHeight(2* x);
rect.setWidth(2* x);
rect.setStroke(Color.BLUE);
rect.setFill(Color.BLUE);
rect.setStrokeWidth(3);
//created circle
//set properties
Circle c = new Circle(x);
c.setStroke(Color.RED);
c.setFill(Color.RED);
c.setStrokeWidth(3);
Line line11= new Line(-x /1.5,-x /2.5, x /1.5,-x /2.5);
Line line12= new Line(0,-x,0, x);
line11.setStroke(Color.GREEN);
line11.setStrokeWidth(6);
line12.setStroke(Color.GREEN);
line12.setStrokeWidth(6);
StackPane lines = new StackPane();
GridPane pane = new GridPane();
pane.setPadding(new Insets(10,10,10,10));
pane.add(lines,2,2);
pane.add(rect,0,0);
pane.add(c,1,1);
pane.add(new Group(),2,2);
Scene scene = new Scene(pane);
primaryStage.setTitle("Shapes in Grid");
primaryStage.setScene(scene);
primaryStage.show();
primaryStage.setResizable(false);
}
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

1. Identify three communication approaches to identity.

Answered: 1 week ago

Question

d. Who are important leaders and heroes of the group?

Answered: 1 week ago

Question

3. Describe phases of minority identity development.

Answered: 1 week ago