a brief explanation of how this code works you can just explain the main part thank you
Fantastic news! We've Found the answer you've been seeking!
Question:
a brief explanation of how this code works
you can just explain the main part thank you
(I have attached the code screenshot and the code output below)
Transcribed Image Text:
40 import javafx.application. Application; 12 13 public class ShowRectangle extends Application { 140 @Override // Override the start method in the Application class public void start (Stage primaryStage) { // Create rectangles Rectangle r1= new Rectangle (25, 10, 60, 30); r1.setStroke (Color.BLACK) ; 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 460 47 48 49 500 51 52 53 } } r1.setFill(Color.WHITE); Rectangle r2 = new Rectangle (25, 50, 60, 30); Rectangle r3 = new Rectangle (25, 90, 60, 30); r3.setArcWidth (15); r3.setArcHeight (25); } // Create a group and add nodes to the group Group group = new Group(); group.getChildren().addAll(new Text(10, 27, "r1"), r¹, new Text (10, 67, "r2"), r2, new Text (10, 107, "r3"), r3); for (int i = 0; i < 4; i++) { Rectangle r = new Rectangle (100, 50, 100, 30); r.setRotate(i * 360 / 8); r.setStroke (Color.color(Math.random(), Math.random(), Math.random())); r. setFill(Color.WHITE); group.getChildren().add(r); } // Create a scene and place it in the stage Scene scene = new Scene(new Border Pane(group), 250, 150); primaryStage.setTitle("ShowRectangle") ; // Set the stage title primaryStage.setScene (scene); // Place the scene in the stage primaryStage.show(); // Display the stage /** * The main method is only needed for the IDE with limited *JavaFX support. Not needed for running from the command line. */ public static void main(String [] args) { launch(args); 40 import javafx.application. Application; 12 13 public class ShowRectangle extends Application { 140 @Override // Override the start method in the Application class public void start (Stage primaryStage) { // Create rectangles Rectangle r1= new Rectangle (25, 10, 60, 30); r1.setStroke (Color.BLACK) ; 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 460 47 48 49 500 51 52 53 } } r1.setFill(Color.WHITE); Rectangle r2 = new Rectangle (25, 50, 60, 30); Rectangle r3 = new Rectangle (25, 90, 60, 30); r3.setArcWidth (15); r3.setArcHeight (25); } // Create a group and add nodes to the group Group group = new Group(); group.getChildren().addAll(new Text(10, 27, "r1"), r¹, new Text (10, 67, "r2"), r2, new Text (10, 107, "r3"), r3); for (int i = 0; i < 4; i++) { Rectangle r = new Rectangle (100, 50, 100, 30); r.setRotate(i * 360 / 8); r.setStroke (Color.color(Math.random(), Math.random(), Math.random())); r. setFill(Color.WHITE); group.getChildren().add(r); } // Create a scene and place it in the stage Scene scene = new Scene(new Border Pane(group), 250, 150); primaryStage.setTitle("ShowRectangle") ; // Set the stage title primaryStage.setScene (scene); // Place the scene in the stage primaryStage.show(); // Display the stage /** * The main method is only needed for the IDE with limited *JavaFX support. Not needed for running from the command line. */ public static void main(String [] args) { launch(args);
Expert Answer:
Answer rating: 100% (QA)
a JavaFX application that creates a scene with several rectangles Some of the rectangles have sharp ... View the full answer
Related Book For
Government and Not for Profit Accounting Concepts and Practices
ISBN: 978-1118983270
7th edition
Authors: Michael Granof, Saleha Khumawala, Thad Calabrese, Daniel Smith
Posted Date:
Students also viewed these programming questions
-
The Porsche Shop, founded in 1985 by Dale Jensen, specializes in the restora- tion of vintage Porsche automobiles. One of Jensen's regular customers asked him to prepare an estimate for the...
-
A road building company is purchasing an excavator for $500,000. The corporate tax rate is 45% and the expected after-tax rate of return is 12%. What would be the present value of the future tax...
-
(20 points)Write a program that prompts the user to input five decimal numbers. The program should then add the five decimal numbers, convert the sum to the nearest integer, and print the result....
-
Prepare a company analysis (strengths and weaknesses) Instructions - Prepare the SW portion of a SWOT analysis as a report. Use your textbook and the instruction below. Prioritizing the Results: The...
-
Two point charges (+ 10.0nC and 10.0nC) are located 8.00 cm apart. (a) What is the electric potential energy when a point charge of 4.2nC is placed at points a, b, and c in turn? Let U = 0 when the...
-
You are a human resources training specialist working for a large international automaker. Your company will soon complete the construction of a plant in Sonora, Mexico. This plant will specialize in
-
The following business transactions represent selected cash receipts (cash inflows) and cash payments (cash outflows) of Ridge Development Corporation. a. dividend payment b. payment of insurance...
-
Your traditional IRA account has stock of GFH, which cost $2,000 20 years ago when you were 50 years old. You have been very fortunate, and the stock is now worth $23,000. You are in the 35 percent...
-
Explain about information movements of trucking logistics? (Give some explaination about the flows)
-
Regulators, in protecting the public interest, are examining Wincox Insurance Company's financial statements. These regulators impose requirements on Wincox's financial statements because of which...
-
This week we will learn to perform Analysis of Variance (ANOVA) using both Excel and R/RStudio. Suppose that we want to perform ANOVA to determine if the mean ACT score at a small college is the same...
-
Which of the following statements is correct regarding Avogadro's number? O Avogadro's number is the amu in one mole of a substance. O Avogadro's number is the number of moles in 6.02 x 1023 grams of...
-
Assume you are in the role of a Department Director or leader. Discuss the utility of both Financial Accounting and Managerial Accounting to your position and the decisions you will need to make?
-
Write the process necessary to create a 64-bit arithmetic shift register. In addition to the normal synchronous inputs, your register should also provide the following synchronous shift signals:...
-
Write a process that will generate a single cycle pulse every 20 clock cycles. In other words, your process should send out a single pulse every 20 clock cycles that has a pulse width equal to the...
-
Which measured value contains a zero that is NOT a significant figure? 08.08 O 0.984 O 65.0 40.00 O All of the zeroes are significant figures in the measured values above.
-
For a given compound formed by ionic bonding, calculate the total net potential energy of A2B3 ion pair, if the ionic radius of the cation is 0.045 nm and that of the anion is 0.187 nm. The value of...
-
Explain how the graph of each function can be obtained from the graph of y = 1/x or y = 1/x 2 . Then graph f and give the (a) Domain (b) Range. Determine the largest open intervals of the domain over...
-
A state imposes a sales tax of 6 percent. The state's counties are permitted to levy an additional tax of 2 percent. The state administers the tax for the counties, forwarding the proceeds to the...
-
The Pleasant Valley School District, which leases its buses from a private transportation company, has determined that the direct costs of operating a bus (including rental fees, driver, and fuel) is...
-
As indicated in Chapter 2, the GASB defines assets as "resources with present service capacity that the government presently controls." It explains that present service capacity of an asset is its...
-
A cost sheet and partial finished goods ledger card for Leather Originals, a manufacturer of leather furniture, are provided in the Working Papers. Work independently to complete the following...
-
Krasnoy Tire, a maker of tires for cars, trucks, and tractors, is trying to determine how to account for various factory costs. The costs include the following: a. Wages earned by a factory...
-
Wilmington, Inc., manufactures heating systems. The company maintains a materials ledger for all direct materials. Instructions: 1. Prepare a materials ledger card for T-5 thermostats. The thermostat...
Study smarter with the SolutionInn App