Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I have been writing this code ( Java ) for a couple days now and it isn't running at all. The error code I keep
I have been writing this code Java for a couple days now and it isn't running at all. The error code I keep getting is: Error: Could not find or load main class Shapes.
Caused by: java.lang.NoClassDefFoundError: javafxapplicationApplication My code is this its in a package also: 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
created rectangle
set properties
Rectangle angle new Rectangle;
angle.setX;
angle.setY;
angle.setHeight x;
angle.setWidth x;
angle.setStrokeColorBLUE;
angle.setFillColorBLUE;
angle.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.addangle;
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