Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
11th Edition
ISBN: 9780134670942
Author: Y. Daniel Liang
Publisher: PEARSON
Question
Book Icon
Chapter 14, Problem 14.27PE
Program Plan Intro

Draw a detailed clock

Program Plan:

  • Import required packages.
  • Define the main class “E27” that extends the “Application” class.
    • The method “start ()” overrides the start method in the “Application” class.
    • Create a clock pane
    • Create a string to display the time.
    • Add the created string to the label.
    • Create a border pane and set it to center.
    • Set the label at the bottom.
    • Create a scene and place it on the stage.
    • Display the stage using “show ()” method.
    • Define the “main ()” method.
      • Launch the application.
  • Create a class “DetailedClockPane” that extends Pane.
    • Declare required parameters for the clock.
    • Define the constructor with no parameters.
      • Get the current time.
    • Define the constructor with three parameters.
      • Set the hour, minute and second.
    • Use accessors and mutators methods to get and set the hour, minute and seconds.
    • Set the current hour, minute and seconds inside the function “setCurrentTime ()”.
      • Finally call the function “paintClock ()”.
    • Give function definition for “paintClock ()”.
      • Initialize the clock parameters.
      • Create a circle using “new Circle ()”.
      • Set the color and stroke color for the circle.
      • Set the length to draw second’s hand.
      • Draw the second hand by creating a line using “new Line ()”.
      • Set the stroke color.
      • Set the length to draw minute’s hand.
      • Draw the minute hand by creating a line using “new Line ()”.
      • Set the stroke color.
      • Set the length to draw hour’s hand.
      • Draw the hour hand by creating a line using “new Line ()”.
      • Set the stroke color.
      • Now, clear the pane using “clear ()” method.
      • Add the circle and three lines to the pane.
      • Add more details to the clock.
      • Use “for” loop to display hours on the clock.
    • Give function definition for “setWidth ()” to set width.
      • Set the width of the pane.
      • Call the function “paintClock ()”.
    • Give function definition for “setHeight ()” to set height.
      • Set the height of the pane.
      • Call the function “paintClock ()”.

Blurred answer
Students have asked these similar questions
(See attached photo) Please explain the flow of finding the exact running time of the program. The attached photo's answer is already correct only explanation is needed.
(See attached photo) Please explain the exact running time of the program. The attached photo's answer is already correct only the explanation of getting the exact running time is needed.  LEFT SIDE IS THE EXECUTION AND THE CODE, RIGHT SIDE IS THE COMPUTATION/SOLUTION/COMPUTATION
(CLO3) Read the following description and answer the following questions about it: Problem Description: A car dealership allows customer to purchase their new cars with different options. At this time, those options are color, model, and air condition, as shown below in class CustomerOrder. Of course, the dealership wants the software to be flexible enough to be able to add more options in the future, if needed. CustomerOrder -carColor: String -carModel: String -hasAirCondition: boolean Q1) Write the full required code in Java to use the Builder design pattern to create class CustomerOrder. Q2) Write a Java main() method to create an object of class CustomerOrder with color "red" and without air condition.

Chapter 14 Solutions

Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)

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
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education