Write a program that displays a clock and sets the time with the input from three text
Question:
Write a program that displays a clock and sets the time with the input from three text fields, as shown in Figure 16.38b. Use the ClockPane in Listing 14.21. Resize the clock to the center of the pane.
Listing
Transcribed Image Text:
12 3 6 30 Second 4 Minute 45 Hour (b) 1 import java.util.Calendar; 2 import java.util.GregorianCalendar; 3 import javafx.scene.layout.Pane; import javafx.scene.paint.Color; 5 import javafx.scene.shape.Circle; 6 import javafx.scene.shape.Line; 7 import javafx.scene.text.Text; 9 public class ClockPane extends Pane { private int hour; private int minute; private int second; 10 11 12 13 // Clock pane's width and height| private double w - 250, h = 250; 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 /** Construct a default clock with the current time*/ public ClockPane() { setCurrentTime(); /** Construct a clock with specified hour, minute, and second */ public ClockPane(int hour, int minute, int second) { this.hour = hour; this.minute = minute; this.second - second; paintClock (); /** Return hour */ public int getHour() { return hour; 31 32 34 35 /** Set a new hour */ public void setHour(int hour) { this.hour = hour; paintClock (); 36 37 38 39 40 /** Return minute */ public int getMinute() { return minute; 41 42 43 44 45 mmm mmm r
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 80% (10 reviews)
Program Plan The program displays a clock and that sets the time from the input that is provided by ...View the full answer
Answered By
Aysha Ali
my name is ayesha ali. i have done my matriculation in science topics with a+ . then i got admission in the field of computer science and technology in punjab college, lahore. i have passed my final examination of college with a+ also. after that, i got admission in the biggest university of pakistan which is university of the punjab. i am studying business and information technology in my university. i always stand first in my class. i am very brilliant client. my experts always appreciate my work. my projects are very popular in my university because i always complete my work with extreme devotion. i have a great knowledge about all major science topics. science topics always remain my favorite topics. i am also a home expert. i teach many clients at my home ranging from pre-school level to university level. my clients always show excellent result. i am expert in writing essays, reports, speeches, researches and all type of projects. i also have a vast knowledge about business, marketing, cost accounting and finance. i am also expert in making presentations on powerpoint and microsoft word. if you need any sort of help in any topic, please dont hesitate to consult with me. i will provide you the best work at a very reasonable price. i am quality oriented and i have 5 year experience in the following field.
matriculation in science topics; inter in computer science; bachelors in business and information technology
_embed src=http://www.clocklink.com/clocks/0018-orange.swf?timezone=usa_albany& width=200 height=200 wmode=transparent type=application/x-shockwave-flash_
4.40+
11+ Reviews
14+ 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 displays a heap graphically, as shown in Figure 23.10. The program lets you insert and delete an element from the heap. Exercise23_10 78 56 34 43 4 1 15 2 23 Enter a key: 78...
-
Write a program that displays all the prime numbers less than 120 in decreasing order. Use the StackOfIntegers class to store the prime numbers (e.g., 2, 3, 5,... ) and retrieve and display them in...
-
Write a program that displays all the numbers from 100 to 200, ten per line, that are divisible by 5 or 6, but not both. Numbers are separated by exactly one space.
-
Answer the following questions. a. Office Store has assets equal to $123,000 and liabilities equal to $47,000 at year-end. What is the total equity for Office Store at year-end? b. At the beginning...
-
A player i is called a null player in a game (N, w) if he contributes nothing to any coalition, that is, if w(S {i}) = w(S) for every S N Verify that the Shapley value of a null player is zero,...
-
Round off the following measurement to three significant digits: 7268 mL. (a) 720 mL (b) 726 mL (c) 727 mL (d) 7260 mL (e) 7270 mL.
-
Sabrina Ederly worked as a reporter and contributing editor for Rolling Stone magazine. Ederly intended to write an article for the magazine that focused on the alleged rape of a University of...
-
The trial balance columns of the worksheet for Warren Roofing at March 31, 2017, are as follows. Other data: 1. A physical count reveals only $480 of roofing supplies on hand. 2. Depreciation for...
-
ohn is preparing to play football at State University, which has a nationally ranked football program. He has been offered a generous scholarship, including 5 years of free tuition, free books, and...
-
Assume a large number of cardboard sheets with 23 inch width is available. From these 23 inch sheets, we need to cut sheets with width 6 inch and 8 inch, in only one direction. The demand for sheets...
-
Write a program that enables the user to specify the location and size of the circles and displays whether the two circles intersect, as shown in Figure 16.39a. Enable the user to point the mouse...
-
Write a program that sets the horizontalalignment and column-size properties of a text field dynamically, as shown in Figure 16.38a. Text Field JavaFX Left Column Size Right 12 Center (a)
-
Mature crocodiles secrete from their skin glands the compound with the following structure. This compound is thought to be a communication pheromone for nesting or mating. a. How many stereogenic...
-
2. Given the following producer&consumer problem solution, what is the potential risk in the code when the solution is running on a single CPU, multitasking operating system? Assume we need run...
-
Examine the case provided [new window]. Create a report that is to be submitted by the deadline. Identify and discuss the key issues/challenges in the case. Identify the stakeholders and state how...
-
1. An economic analysis is used to determine the profitability of a machine. Assume the minimum attractive rate of return (interest rate) is 3%. What is the present worth of this investment...
-
Develop an interview strategy you would consider using to interview and select a diverse pool of qualified candidates for your organization. For job description for section 8 low income housing . As...
-
After reviewing the presentation it is my opinion that affirmative action is still an important tool in combating racial, gender and other forms of discrimination in the workplace. While the goals of...
-
When should a company begin gathering information about differences between IFRS and its existing GAAP to assist in its first time adoption of IFRS?
-
You are interested in investing and are considering a portfolio comprised of the following two stocks. Their estimated returns under varying market conditions are provided: (note: it is difficult to...
-
In this exercise we look at memory locality properties of matrix computation. The following code is written in C, where elements within the same row are stored contiguously. Assume each word is a...
-
Caches are important to providing a high-performance memory hierarchy to processors. Below is a list of 32-bit memory address references, given as word addresses. 3, 180, 43, 2, 191, 88, 190, 14,...
-
For a direct-mapped cache design with a 32-bit address, the following bits of the address are used to access the cache. 1. What is the cache block size (in words)? 2. How many entries does the cache...
-
Consumers will adopt the Philip Morris innovative product differently. For any new product, there will be pioneers and early adopters. The rate of adoption of an innovation is dependent on its...
-
If infrastructure spending generates a positive externality, what effect should this have on government policy? Will voters be more or less likely to support government spending programs on...
-
Solve the last part with lingo as its required: Question 2. A cargo plane has three compartments for storing cargo: front, centre and rear. These compartments have the following limits on both...
Study smarter with the SolutionInn App