MAKING A DIGITAL CLOCK IN JAVA
Does making a Digital Clock in Java sounds cool to you? If yes then you, my friend definitely are in the place. SOURCE CODE import java.awt.Font; import java.awt.Color; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.Timer; import javax.swing.SwingConstants; import java.util.*; import java.text.*; public class Clock { public static void main(String[] args) { JFrame.setDefaultLookAndFeelDecorated(true); JFrame frame = new JFrame("Digital Clock"); frame.setSize(300,150); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLayout(new GridLayout(3, 1)); ClockLabel dateL = new ClockLabel("date"); ClockLabel timeL = new ClockLabel("time"); ClockLabel dayL = new ClockLabel("day"); frame.add(dateL); f