Question: I am trying to write a label on a shape, but it doesn't work, and I am not sure why even when I delete the

 I am trying to write a label on a shape, but

I am trying to write a label on a shape, but it doesn't work, and I am not sure why even when I delete the label the rectangle doesn't even appear!

please guide me through this without changing the core code:)

2 hello world 21 1 package application; 3+ import javafx.application. Application; 11 12 13 public class Main extends Application { 140 @Override 15 public void start(Stage primaryStage) { 16 Rectangle r = new Rectangle (); 17 r.setFill(color. TRANSPARENT); 18 r.setStroke (Color.BLACK); 19 Label lbl = new Label ("hello world"); 20 StackPane general = new StackPane (); 22 general.getChildren() .add(r); 23 general.getChildren() .add(161); 24 25 Scene scene = new Scene (general); 26 primaryStage.setScene (scene); 27 primaryStage.setTitle(STYLESHEET_CASPIAN); 28 primaryStage.show(); 29 30 31 } 32 33 340 public static void main(String[] args) { Launch(args); } 35 36 37 } 38

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!