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:
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…