Answered step by step
Verified Expert Solution
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 ;
public static void launchString args
launchargs;
@Override
public void startStage primaryStage
throws Exception
created rectangle
set properties
Rectangle rect new Rectangle;
rect.setX;
rect.setY;
rect.setHeight x;
rect.setWidth x;
rect.setStrokeColorBLUE;
rect.setFillColorBLUE;
rect.setStrokeWidth;
created circle
set properties
Circle c new Circlex;
csetStrokeColorRED;
csetFillColorRED;
csetStrokeWidth;
Line line new Linex x x x ;
Line line new Linex x;
linesetStrokeColorGREEN;
linesetStrokeWidth;
linesetStrokeColorGREEN;
linesetStrokeWidth;
StackPane lines new StackPane;
GridPane pane new GridPane;
pane.setPaddingnew Insets;
pane.addlines;
pane.addrect;
pane.addc;
pane.addnew Group;
Scene scene new Scenepane;
primaryStage.setTitleShapes in Grid";
primaryStage.setScenescene;
primaryStage.show;
primaryStage.setResizablefalse;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started