Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
