Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Stopwatch 1 Description: Create a Java 8 SE application in NetBeans using JavaFX that implements a stopwatch that has an analog, a digital display, and

Stopwatch 1 Description: Create a Java 8 SE application in NetBeans using JavaFX that implements a stopwatch that has an analog, a digital display, and a record board. The analog display is comprised of a dial with tick marks and a sweeping hand that displays the elapsed time in 1 second increments with a smooth response between seconds. The digital display shows the elapsed time in minutes, seconds, and hundredths of a second, mm:ss.SS, and displays the elapsed time in 1 centisecond increments (hundredth of a second). The stopwatch has two buttons. When the stopwatch is first initialized the two buttons will be Record and Start. When the stopwatch is running the two buttons will be Record and Stop. When the stopwatch is stopped, or paused, the two buttons will be Reset and Start. The text on the two buttons should be displayed dynamically and change dynamically. The record board will be used to record the lap time between different clicks. When the Record button is clicked, the calculated difference will be recorded and displayed on the record board. The record board consist of three labels, the newest record will always replace the oldest one. If the stopwatch has not started yet, then the record button should not have any action. Purpose: This challenge develops skills in creating and manipulating JavaFX interfaces, generating and handling events, having dynamically generated layouts, and organizing code correctly. Requirements: Project Name: Stopwatch For the Project Name, follow the same naming scheme used in the first challenge. The Project Name is to be comprised of your pawprint with the first letter capitalized followed by Stopwatch. For example, if the pawprint is abcxyz9 the project is to be named Abcxyz9Stopwatch. This challenge allows you to apply your creativity while meeting a set of requirements. Not every aspect of the application is described in the requirements. The requirements establish what functionality must exist, but it is up to you to apply your creativity in implementing the functionality and the user interface to support that functionality. Platform: Java 8 SE, JavaFX. Project IDE: NetBeans Create a stopwatch application that contains an analog, a digital display, and a record board. The analog display, minimally, contains a circular dial with 60 tick marks where each tick mark represents 1 second of elapsed time and a sweeping hand that increments to the next tick mark every elapsed second. See Figure 1: Analog Interface for an example. It takes 60 seconds for the hand to sweep one time around the dial. The digital display, minimally, shows minutes, seconds, and hundredths of a second in a mm:ss:SS format. For each elapsed centisecond (hundredth of a second), the digital display is to increment 1 centisecond (hundredth of a second). The digital display is to increment 1 second after the hundredths of a second is equal to 100. The record Stopwatch 2 board, minimally, will be used to record the time of three different laps. See Figure 2: Record Board for an example. (Minimally means you can do more if youd like, which is usually rewarded. You could display hours, milliseconds, or nanoseconds, etc.) Figure 1: Analog Interface Example Figure 2: Record Board Example The stopwatch has two buttons. When the stopwatch is initialized, the two buttons will be Record and Start. When the stopwatch is in motion and running, the two buttons will be Record and Stop. If the user presses the Stop button and the stopwatch is no longer in motion or running, then the two buttons will be Reset and Start. If the user presses the reset button, the two buttons will return to Record and Start. Therefore, the buttons will change dynamically depending on the current state of the stopwatch. The start button will start the stopwatch. The stop button will halt the stopwatch. The reset button resets the displays, elapsed time, lap count, places the displays in a halt state, and clears the record board. The record button will take the current time displayed at the moment the button was pressed, subtract it from the previous lap time, and record the current lap time on the board in the same format as the digital display, mm:ss:SS. Therefore, pressing the record button, will result in the difference between the two button clicks or the difference between the current time and the last lap time. If you were able to press the lab button, then immediately press the stop button, without letting any time lapse, the sum of all the individual lap times should equal the total time shown on the digital display. Starting the stopwatch causes it to increment from the last elapsed time value. If the stopwatch is at 0 and the start button is pressed, the stopwatch increments from 0. If the stopwatch is stopped at 00:07.11 and then the start button is selected, the stopwatch will increment from 00:07.11. The reset button is used to set the stopwatch to 0 and place it in a halted state. If the elapsed time of the stopwatch is 00:07.11 and the record button is pressed for the first time, then the current time of 00:07.11 will be displayed to the record board while keeping track of which lap it is. However, if the start button has not been pressed for the first time, meaning the stopwatch has not started yet, then the record button has no action and if pressed, nothing will happen. Stopwatch 3 The record board consist of three Labels, when the Record button is clicked for the first time, the time on the digital display will be displayed on the first label with a lap of 1. If the Record button is clicked for the second time, the difference between the first click and the second click will be calculated (The difference between the current time and the last lap time), and then displayed in the second label with a lap of 2. If the Record button is clicked for the third time, you will repeat the procedure, take the difference of the current time and the last lap time, and display the result in the third label with lap equal to 3. However, if the Record is clicked for the fourth time, the first label will be changed, and this process is repeated. Therefore, the newest record will always replace the oldest one. After the Reset button is clicked, the record board will be initialized back to --:--.--" for all the labels, the lap count and difference between the laps will be set back to zero, and the record board should look the same as it was in the beginning. Here are some example images of record board: At the Beginning After First Click After Second Click After Third Click After Fourth Click After Reset Button Two image files are provided with this challenge that you can use: clockface.png and hand.png. You are not required to use the provided images. If you want to use alternatives, that is okay. The clockface.png image is the dial of the stopwatch. The hand.png image is the sweeping hand of the stopwatch. How you layout the user interface is up to you. You get to decide the locations of the analog display, digital display, record board, and the two dynamically changing buttons. Whatever you choose should be a well-organized, thoughtful, aesthetically pleasing, and useable interface or an interface that logically makes sense. The layout should look like you made intentional choices and are in control of their placement. This means the layout should not be a disorganized mess that is a result of not knowing how to implement the user interface, layout, and/or code in a meaningful way. You may expand the functionality beyond the basic requirements provided above if you choose. Usually expanding beyond the basic requirements gets rewarded. You could do the following for example: Stopwatch 4 Add an additional sweeping hand that displays the minutes elapsed on the analog stopwatch Add an additional sweeping hand that displays the hours elapsed on the analog stopwatch Add an additional smaller hand, that is underneath the seconds hand, that displays hundredths of a second on the analog stopwatch Add hours to the digital display Add milliseconds to the digital display Add nanoseconds to the digital display Add additional functionality to the stopwatch (Could add additional buttons, etc.) Change the colors of the buttons (For example, when the Start button is showing the buttons color could be green and when the Stop button is showing the buttons color could be red) Add additional record board labels For inspiration: https://en.wikipedia.org/wiki/Stopwatch Run your application and make sure everything works as expected. Export the project directory located in your NetBeans project folder. You will use NetBeans to export a ZIP file and submit the ZIP on Canvas

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions