Revise Listing 18.9 to develop a program that lets the user use the + and ? buttons
Question:
Revise Listing 18.9 to develop a program that lets the user use the + and ? buttons to increase or decrease the current order by 1, as shown in Figure 18.12a. The initial order is 0. If the current order is 0, the Decrease button is ignored.
Listing
Transcribed Image Text:
(a) 1 import javafx.application. Application; 2 import javafx.geometry.Point2D; 3 import javafx.geometry. Pos; 4 import javafx.scene.Scene; 5 import javafx.scene.control.Label; 6 import javafx.scene.contro1.TextField; 7 import javafx.scene.layout.BorderPane; 8 import javafx.scene.layout. HBox; 9 import javafx.scene.layout.Pane; |10 import javafx.scene.paint.Color; |11 import javafx.scene.shape. Polygon; |12 import javafx.stage.Stage; |13 14 public class SierpinskiTriangle extends Application { 15 @Override // Override the start method in the Application class 16 public void start(Stage primaryStage) { SierpinskiTrianglePane trianglePane = new SierpinskiTrianglePane (); TextField tforder = new TextField(); tfOrder.setOnAction( 17 18 19
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 63% (11 reviews)
Output A program to demonstrate Sierpinski Triangle in a ...View the full answer
Answered By
Nyron Beeput
I am an active educator and professional tutor with substantial experience in Biology and General Science. The past two years I have been tutoring online intensively with high school and college students. I have been teaching for four years and this experience has helped me to hone skills such as patience, dedication and flexibility. I work at the pace of my students and ensure that they understand.
My method of using real life examples that my students can relate to has helped them grasp concepts more readily. I also help students learn how to apply their knowledge and they appreciate that very much.
4.00+
1+ Reviews
10+ Question Solved
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Question Posted:
Students also viewed these Computer science questions
-
Write a program that lets the user enter numbers from a graphical user interface and displays them in a text area, as shown in Figure 20.17a. Use a linked list to store the numbers. Do not store...
-
Write a program that lets the user click on a pane to dynamically create and remove points (see Figure 15.28a). When the user left-clicks the mouse (primary button), a point is created and displayed...
-
Write a program that lets the user to enter the order and display the filled Sierpinski triangles as shown in Figure 18.18. Enter an order: Enter an order: Enter an order: Enter an order:
-
The dehydration butanol of alumina is carried out over a silica-alumina catalyst at 680K. CH3CH2CH2CH20H------->cat CH3CH=CHCH3 + H2O The rate law is -r Bu = KPBU/(1+KBuPBul with k= 0.054...
-
Every best element is a maximal element, and not vice versa.
-
Pro-Forma Income Statement Gamma Manufacturing, Inc., is a manufacturer of electric pencil sharpeners. The following is information regarding Gamma Manufacturing for the fiscal year-end, May 31,...
-
Categories are pointers to knowledge. Once you know that something is in a category, you know a lot of general things about it and can focus your energy on specifying what is special about this...
-
Develop a Pareto chart of the following causes of poor grades on an exam: Reason for Poor Grade Frequency Insufficient time to complete ............ 15 Late arrival to exam ............... 7...
-
Question 11 of 12 -/1 E 2019 MARIGOLD COMPANY COMPARATIVE BALANCE SHEET AS OF DECEMBER 31, 2020 AND 2019 2020 Cash $1,780 Receivables 1,750 Inventory 1,590 Plant assets 1,940 Accumulated depreciation...
-
The Western Outfitters Store specializes in denim jeans. The variable cost of the jeans varies according to several factors, including the cost of the jeans from the distributor, labor costs,...
-
Write a Java program that displays ovals, as shown in Figure 18.12b. The circles are centered in the pane. The gap between two adjacent circles is 10 pixels, and the gap between the border of the...
-
Modify Listing 18.8, TowerOfHanoi.java, so that the program finds the number of moves needed to move n disks from tower A to tower B. Listing 1 import java.util.Scanner; 2 3 public class Tower0fHanoi...
-
Ascend Company makes three models of jump drives in its factory: J512, J1G, and J4G. The expected overhead costs for the next fiscal year are as follows: Payroll for factory managers...
-
1. Gluteus maximus muscle and mention the structures covered by it.
-
2. External features and relations of Kidney.
-
3. Features of Synovial joint and its classification.
-
1. Name the paranasal air sinuses.
-
2. Name the ventricles of Brain.
-
A researcher from the University of California, San Diego, collected data on average per capita wine consumption and heart disease death rate in a random sample of 19 countries for which data were...
-
What is taxable income, and what is the formula for determining taxable income?
-
If we let n denote the size of set S, and m denote the size of set T, what would be the running time of the operation S.retainAll(T) when both sets are implemented using hashing?
-
If we let n denote the size of set S, and m denote the size of set T, what would be the running time of the operation S.removeAll(T) when both sets are implemented using hashing?
-
If we let n denote the size of set S, and m denote the size of set T, what would be the running time of the operation S.addAll(T), as implemented on page 446, if both sets were implemented using...
-
A taxpayer can claim a personal exemption for any person he or she provides over 50 percent of support during the tax year. True False
-
Holding other variables constant, a recession in the US economy should: Select one: A) cause a depreciation of the dollar because the nominal interest rate in the United States would increase b)...
-
CROSS RATES The table below gives the exchange rates between U.S. dollar, British pound and Swedish krona. What is the exchange rate between Swedish kronas and pounds? Round your answer to two...
Study smarter with the SolutionInn App