Introduction to Java Programming and Data Structures: Brief Version (11th Global Edition)
11th Edition
ISBN: 9780134671710
Author: Y. Daniel Liang
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 14.11, Problem 14.11.6CP
Program Plan Intro
Shapes:
There are many shape classes in JavaFX in order to draw shapes like circles, rectangles, arcs, texts, polygons, etc. It is an abstract class that describes some common properties like “fill”, “stroke”, and “strokeWidth” for all shapes.
- “fill” property – It is used to specify a color that has to be given inside the shape.
- “stroke” property – It is used to specify the outline color.
- “strokeWidth” property – It is used to specify the thickness of the stroke.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Write the code to draw a polygon with points at (10, 10), (15, 30), (140, 10), and (10, 100). Fill the shape with red.
3. Randomly generate a number in range [1, 12]. Map this number to a season: if the
number is 3, 4, or 5, map it to “Spring", if the number is 6, 7, or 8, map it to
"Summer", if the number is 9, 10, or 11, map it to "Fall", and if the number 12, 1, or
2, map it to "Winter". Display season name
Write code to draw the following poicture
Chapter 14 Solutions
Introduction to Java Programming and Data Structures: Brief Version (11th Global Edition)
Ch. 14.2 - Explain the evolution of Java GUI technologies.Ch. 14.2 - Prob. 14.2.2CPCh. 14.3 - Prob. 14.3.1CPCh. 14.3 - Show the output of the following JavaFX program:...Ch. 14.4 - How do you create a Scene object? How do you set a...Ch. 14.4 - Prob. 14.4.2CPCh. 14.4 - Prob. 14.4.3CPCh. 14.4 - How do you replace the code in lines 20 and 21 in...Ch. 14.5 - Prob. 14.5.1CPCh. 14.5 - Prob. 14.5.2CP
Ch. 14.5 - Can you create an object of IntegerProperty using...Ch. 14.5 - Prob. 14.5.4CPCh. 14.6 - Prob. 14.6.1CPCh. 14.6 - Prob. 14.6.2CPCh. 14.7 - How do you create a color? What is wrong about...Ch. 14.7 - Prob. 14.7.2CPCh. 14.7 - Prob. 14.7.3CPCh. 14.8 - Prob. 14.8.1CPCh. 14.8 - Prob. 14.8.2CPCh. 14.9 - Prob. 14.9.1CPCh. 14.9 - Prob. 14.9.2CPCh. 14.9 - Prob. 14.9.3CPCh. 14.10 - Prob. 14.10.1CPCh. 14.10 - Prob. 14.10.2CPCh. 14.10 - Prob. 14.10.3CPCh. 14.10 - Prob. 14.10.4CPCh. 14.10 - Prob. 14.10.5CPCh. 14.11 - How do you display a text, line, rectangle,...Ch. 14.11 - Prob. 14.11.2CPCh. 14.11 - Prob. 14.11.3CPCh. 14.11 - Write code fragments to fill red color in a...Ch. 14.11 - Prob. 14.11.5CPCh. 14.11 - Prob. 14.11.6CPCh. 14.11 - Write code fragments to display the outline of the...Ch. 14.11 - Write code fragments to display the lower half of...Ch. 14.11 - Write code fragments to display a polygon...Ch. 14.11 - Write code fragments to display a polygon...Ch. 14.11 - Prob. 14.11.11CPCh. 14.12 - Prob. 14.12.1CPCh. 14 - Prob. 14.1PECh. 14 - Prob. 14.2PECh. 14 - (Display three cards) Write a program that...Ch. 14 - (Color and font) Write a program that displays...Ch. 14 - (Characters around circle) Write a program that...Ch. 14 - Prob. 14.6PECh. 14 - (Display random 0 or 1) Write a program that...Ch. 14 - (Create four fans) Write a program that places...Ch. 14 - (Display a cylinder) Write a program that draws a...Ch. 14 - Prob. 14.11PECh. 14 - (Display a bar chart) Write a program that uses a...Ch. 14 - Prob. 14.13PECh. 14 - (Display a rectanguloid) Write a program that...Ch. 14 - Prob. 14.15PECh. 14 - Prob. 14.16PECh. 14 - (Game: hangman) Write a program that displays a...Ch. 14 - Prob. 14.18PECh. 14 - (Plot the sine and cosine functions) Write a...Ch. 14 - (Draw an arrow line) Write a static method that...Ch. 14 - Prob. 14.21PECh. 14 - (Connect two circles) Write a program that draws...Ch. 14 - (Geometry: two rectangles) Write a program that...Ch. 14 - (Geometry: Inside a polygon?) Write a program that...Ch. 14 - Prob. 14.25PECh. 14 - Prob. 14.27PECh. 14 - (Random time) Modify the ClockPane class with...Ch. 14 - (Game: bean machine) Write a program that displays...
Knowledge Booster
Similar questions
- Write the code to draw a rectangle centered at (70, 70) with a width of 100 and a height of 100. Fill the rectangle with the color red.arrow_forward8. Please code this for me the basis of the values will be on the second picturearrow_forwardWrite code that uses turtle graphics to draw an equilateral triangle, a square and a regular pentagon, each with side length 100.arrow_forward
- In PYTHON Using one of the loop construct draw:- Twenty vertical lines- Each line of length 150 units(or pixels)- All lines aligned at the same top horizontal margin - Lines 10 units apart each other Note- The first line and all lines in odd positions(e.g. 1, 3, 5, etc.)should besolid lines- The second line and all lines in even positions(e.g. 2, 4, 6, etc.)should be dashed lines - - Set the length of solid segment to 10 units - - Set the length of the non-visible segment to 5 units Assumption- Use of Turtle libraryarrow_forwardSubje ct: $ Comp. Graphics Q. Rotate the following slope about x- axis by A then translete it to the first octaut & reflect it back to onginel prsition 17,,9) (-2,-2, 1) A (9,1,7)arrow_forwardIn PYTHON Using one of the loop construct draw:- Twenty horizontal lines- Each line of length 150 units(or pixels)- All lines aligned at the same left horizontal margin- Lines 10 units apart each other Note- The first line and all lines in odd positions(e.g. 1, 3, 5, etc.) should besolid lines- The second line and all lines in even positions(e.g. 2, 4, 6, etc.)should be dashed lines - - Set the length of solid segment to 10 units - - Set the length of the non-visible segment to 5 units Assumption- Use of Turtle libraryarrow_forward
- 6. The product that may be display for the cod (CINT (- 2.12345)) is c) 3 a) -3 7. Function used to get the positive value of x. a) SQR b) -2 d) 2.123452 e)2 b) ABS 8. Forml.BackColor RGB(R, 255, B). This cod use to coloring the form. b)green c)EXP d )INT e) FIX a)red 9. The default data type in visual Basic is. a)Integer с) етor d) blue e) white c) Variant b)Decimal 10. What is the output of the following Visual Basic Len("Visual Basic Turorial"). d) string e) none of there a)19 b) 0 c) 3 d) 21 e) none of therearrow_forwardWrite code to draw the following picture.arrow_forwardTo draw a horizontal line, you can use A. B. c. D. E. F.arrow_forward
- Please do not give solution in image format thanku Figurel: A solution for the sample input. The rectangular pieces cover the cake entirely, so there are no leftovers. This solution is described in the sample output. Input format: The first line contains p, q, and n, where pxq are the dimensions of the cake and n is the number of roses. Then n lines follow, the i-th line contains the coordinates of the i-th rose, where the first coordinate is between 1 and p and the second coordinate is between 1 and q. Output format: The output contains n+1 lines. The first n lines contain four numbers each: the j-th line contains aj, bj, cj, dj, where 1sajscjsp and 1sbjsdjsq and (aj,bj) and (cj,dj) correspond to the grid squares at the opposite corners of the rectangular piece for the j-th person. The rectangular pieces have to be non-overlapping. The last line contains a single number, the area of the leftovers. The area of the leftovers should be the smallest possible. Code constraints: 0< p, q,…arrow_forwardI hope the solution is to use Visual Basicarrow_forwardWrite R code to Add horizontal and vertical lines to plot.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- New Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT