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: 50% (8 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.
-
Find the products in Problems 2330. -3 [2] 15 -4. [5 -2]
-
In the benzene adsorber of Example 9.7, the flow rate is increased to \(0.25 \mathrm{~m}^{3} / \mathrm{s}\). Calculate the breakthrough time and the fraction of the bed adsorption capacity that has...
-
Sanchez Corporation is considering three long-term capital investment proposals. Relevant data on each project are as follows. Salvage value is expected to be zero at the end of each project....
-
2. (SGS) In this problem, we introduce another version of Gauss-Seidel method. The symmetric Gauss-Seidel method combines the forward and backward versions of Gauss- Seidel methods. We know that FGS...
-
Cate Corp. was organized on March 1, 2019, to operate a delivery service. The firm is authorized to issue 75,000 shares of no-par-value common stock with a stated value of $100 per share and 30,000...
-
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...
-
Which of the following can be a shareholder of an S corporation? a. Resident alien. b. Partnership. c. IRA. d. Estate.
-
Could you provide an example of an organ or system that exhibits sensitivity to damage, and elucidate on a specific aspect of human biology that has evolved as a protective mechanism for it?
-
6) Determine if Rolle's Theorem can be applied. If Rolle's Theorem can be applied, find all values of c in the interval such that f (c) = 0 f(x)=(x+3)(x + 2) closed interval [-3, 2] 10 POINTS 7)...
-
Your employer won a bidding contract to provide auditing services for a Fortune 500 company for the next 6 years. Your company will receive $3,500,000 per year for the next 6 years for these...
-
a. Suppose the government cuts transfer payments in an economy with an inflationary gap. How would this policy affect bond prices, interest rates, investment, the exchange rate, net exports, real...
-
rachel rides her bicycle due at 12 kilometers per hour. Amos rides his bicycle de north at 16 kilometers per hour. if they left from the same point at the same time, how far apart will they be after...
-
On September 1, the balance of the Accounts Receivable control account in the general ledger of Mac Company was $10,960. The customers' subsidiary ledger contained account balances as follows: Jana,...
-
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...
-
Speedy Auto Repairs uses a job-order costing system. The company's direct materials consist of replacement parts installed in customer vehicles, and its direct labor consists of the mechanics' hourly...
-
3. A, B and C are partners sharing profits and losses equally. The balance sheet at 31st December 2020 is as follows. Assets Liabilities Amount Amount (RO) (RO) Creditors 5,000 Cash at Bank 3,000...
-
For each of the following program fragments, give an analysis of the running time. 1) sum = 0; for (int i = n; i > 0; i--) for (int j = 0; j
Study smarter with the SolutionInn App