Question: 1. limer For this exercise, you will need to make an application that has a Graphical User Interface that represents a timer. Template files Controller.java

 1. limer For this exercise, you will need to make anapplication that has a Graphical User Interface that represents a timer. Templatefiles Controller.java o Timer.java View.java Text View.java o GraphicalView.java The Timer has6 buttons, one that will increase and one that decreases hours, minutesand seconds respectively. To create the Timer, we will base ourselves onthe Counter example. To adapt the code for the Counter to implementthe Timer, we will need to change the mode the view, andthe controller Model The previous model was the Counter, we need toreplace this class with a new class Timer. The class Timer hasThe previous model was the Counter; we need to replace this class

1. limer For this exercise, you will need to make an application that has a Graphical User Interface that represents a timer. Template files Controller.java o Timer.java View.java Text View.java o GraphicalView.java The Timer has 6 buttons, one that will increase and one that decreases hours, minutes and seconds respectively. To create the Timer, we will base ourselves on the Counter example. To adapt the code for the Counter to implement the Timer, we will need to change the mode the view, and the controller Model The previous model was the Counter, we need to replace this class with a new class Timer. The class Timer has The previous model was the Counter; we need to replace this class with a new class Timer. The class Timer has: o Three methods that increments the: hours, minutes and seconds respectively o Three methods that decrements the: hours, minutes and seconds respectively o Three methods that returns the: hours, minutes and seconds respectively o We also need to respect the 24 hours cycle: o The hours are between O and 23 The minutes are between O and 59 o The seconds are between O and 59 View You will need to modify the class GraphicalView so that it creates 6 buttons (to increment/decrements hours, minutes, and seconds) as well as a label (JLabel) that indicates the time. We will use a 2 (rows) by 3 (columns) grid to accommodate all these elements. Controller n the Controller, you will need to modify the method "public void actionPerformed (ActionEvent e)" to accommodate the 6 actions launched by the 6 buttons of the GraphicalView and call the corresponding methods from Timer. Here is an example of the result: IncrementMinutes IncrementSeconds imer 19:3:8 DecrementSeconds d.exe- java App Timer 8:0:0 imer 23:0:0 imer 22:0:0 imer 21:0:0 imer 20:0:0 imer 19:0:8 imer 18:0:0 imer 17:0:0 Timer 18:8:8 imer 19:0:0 imer 18:59:0 imer 18:58:0 imer 18:59:0 Timer 19:0:0 imer 19:1:0 imer 19:2:0 imer 19:3:8 imer 19:2:59 imer 19:3:0 import java.awt.event.*; public class Controller implements ActionListener private Timer model; private View] views; private int numberOfViews; public Controller) views- new View[2]; numberofViews 6 model = new Timer() ; register (new GraphicalView(model, this)); register(new TextView(model)) update) public Timer getModel) return model; public view[] getviews ) f return views private void register(View view) t views[numberOfViews] - view; numberOfviews++; private void update) f for (int i e; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!