(Solved) : Use Gui Java Write Application Displays Clock Analog Digital Way Current Time Frame Shown Q42741354 . . .

Use GUI in java, write an application that displays CLOCK inboth analog and digital way of the current time on the same frameas shown below:

Tus 1015.5721CST 2016 TI TITI II w TI II

The above image is only for reference purposes to give you anidea how your final product might look like. Your code must beoriginal. Use the code for Timer class:

public class TimeTester
{
   public static void main(String[] args)
   {
       JFrame frame = new JFrame();
      
       final int FIELD_WIDTH = 20;
       final JTextField textField = newJTextField(FIELD_WIDTH);
      
       frame.setLayout(newFlowLayout());
      
       frame.add(textField);
      
       ActionListener listener = newActionListener()
           {
              public void actionPerformed(ActionEventevent)
              {
                  Date now = new Date();
                 textField.setText(now.toString());
              }
           };
           final int DELAY= 1000;
           // Millsecondsbetweeen timer ticks
           Timer t = newTimer(DELAY, listener);
           t.start();
          
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.pack();
          frame.setVisible(true);
   }
}

Tus 1015.5721CST 2016 TI TITI II w TI II Show transcribed image text Tus 1015.5721CST 2016 TI TITI II w TI II

Expert Answer


Answer to Use GUI in java, write an application that displays CLOCK in both analog and digital way of the current time on the same…

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?