Answered step by step
Verified Expert Solution
Question
1 Approved Answer
a) Create the layout for a digital clock. The clock should have the following layout (1M) JFrame HH MM SS -JPanel JLabel AM/PM so: HH
a) Create the layout for a digital clock. The clock should have the following layout (1M) JFrame HH MM SS -JPanel JLabel AM/PM so: HH - displays the hours MM - displays the minutes SS-displays the seconds AM/PM - displays whether it is before (AM) or after mid-day (PM). The hours/minutes/seconds should be displayed in 36 point, italic serif. b) Make the clock show the current time. For this you should use the Calendar class from java.util with: Calendar.getInstance() - Create Calendar object for current date/time get (field) - return integer field from Calendar object, where field may be Calendar.HOUR, Calendar.MINUTE, Calendar. SECOND, Calendar.AM_PM, etc. the value returned from Calendar.AM_PM may be compared with the values Calendar. AM and Calendar.PM to determine if it is before or after mid-day Create a function that runs continuously and updates the display to always show the current time. (1M) c) Many windows applications have meters that indicate the progress made so far towards completing an activity as a percentage of the anticipated total activity. Write a program to display a progress meter as follows. The meter consists of a window with a column of 11 labels. The first 10 labels indicate progress steps of 10% and are initially red. The bottom label shows the amount of activity remaining as a textual percentage, and is initially set to "0%". (1M) d) Create functionality to simulate steps of 10% progress. For this the user repeatedly presses return on the console inside Eclipse (use a Scanner object for this). Every time, the top-most red label is changed to green and the progress label value is incremented by 10 until that value is 100%. Make sure that no errors occur if the user tries to go past 100%. (1M) Example output: 0% 30% 70%
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started