Java Swing - Digital Clock or Watch (Show System Time and Date) - Study Viral
Java Swing Application - Digital Clock - Study Viral
This Video Helps you to learn how to create simple Digital Clock within Java Swing Application or Program. This is a basic digital clock in Java that works off your operating system time. You can also use the same to show System Date and Time using Netbeans IDE. The Clock will shown on JLabel of java swing Palette by using following classes.
1). Create a Project in Netbeans IDE
2). Create a Package i.e. digital_clock
3). In digital_clock package create a JFrame and name it as DigitalClock
4) Now drag-drop JPanel to JFrame and cover the JFrame.
5). Right click on JPanel Select Set Layout -> Absolute Layout.
6) Now drag-drop four JLabel to JPanel.
7). Select Source Tab to write java code.
8). Import following Classes
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.Timer;
9). Create Timer class object in Global Section
Timer timer ; //At Line 19 in given code
Now you have to type code with in Constructor body.
From Line 22 to Line 53
Rest of Code is given below
Email :: info@studyviral.in
Or
Email :: studyviral.in@gmail.com
Website:: www.StudyViraL.in
Facebook Page :: https://www.facebook.com/StudyViral.in/
For Suggestions You Can Email :: info@studyviral.in
http://studyviral.blogspot.in/
Java Swing Application - Digital Clock - Study Viral
This Video Helps you to learn how to create simple Digital Clock within Java Swing Application or Program. This is a basic digital clock in Java that works off your operating system time. You can also use the same to show System Date and Time using Netbeans IDE. The Clock will shown on JLabel of java swing Palette by using following classes.
1). Create a Project in Netbeans IDE
2). Create a Package i.e. digital_clock
3). In digital_clock package create a JFrame and name it as DigitalClock
4) Now drag-drop JPanel to JFrame and cover the JFrame.
5). Right click on JPanel Select Set Layout -> Absolute Layout.
6) Now drag-drop four JLabel to JPanel.
7). Select Source Tab to write java code.
8). Import following Classes
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.Timer;
9). Create Timer class object in Global Section
Timer timer ; //At Line 19 in given code
Now you have to type code with in Constructor body.
From Line 22 to Line 53
Rest of Code is given below
Email :: info@studyviral.in
Or
Email :: studyviral.in@gmail.com
Website:: www.StudyViraL.in
Facebook Page :: https://www.facebook.com/StudyViral.in/
For Suggestions You Can Email :: info@studyviral.in
http://studyviral.blogspot.in/
Source code
ReplyDelete