0% found this document useful (0 votes)
5 views10 pages

AJP Micro

The document outlines a micro-project proposal and report for creating a digital clock using Java Swing. It details the project's aims, course outcomes, action plan, resources required, methodology, and the skills developed through the project. The project aims to enhance Java and GUI programming skills while providing a practical application for real-time date and time handling.

Uploaded by

Athrva Jadhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views10 pages

AJP Micro

The document outlines a micro-project proposal and report for creating a digital clock using Java Swing. It details the project's aims, course outcomes, action plan, resources required, methodology, and the skills developed through the project. The project aims to enhance Java and GUI programming skills while providing a practical application for real-time date and time handling.

Uploaded by

Athrva Jadhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Annexure – I

Micro-Project Proposal

Digital Clock using Swing

1.0. Aims/Benefits of the Micro-Project


1. Display the current time in hours, minutes and seconds.
2. Design user-friendly interface using swing components.
3. Optionally, display the current date and day of week alongside ethe time.
4. Handle exception and error gracefully.
2.0. Course Outcomes Addressed
a) Develop programs using GUI framework (AWT and Swing). Addressed

b) Handle events of AWT and Swing components. Addressed

c) Develop programs to handle events in Java Programming. Addressed

d) Develop java programs using networking concepts. Not Addressed

e) Develop programs using database. Not Addressed

f) Develop programs using Servlets. Not Addressed

3.0. Action Plan (Sequence and time required for major activity)
Planned
Sr. Planned Name of Responsible
Details of activity Finish
No. Start Date Team Member
Date

Information Gathering and Topic


1
Finalization

Preparing Project Proposal and


2
Approval

3 Implementing Project

4 Preparing Project Report

5 Presenting Project

6 Submission of Project and Report

4.0 Resource Required (Major resources such as raw material, some machining facility, software
etc.)

MET’s Institute of Technology, Polytechnic, Nashik 1


Sr.
Name of Resource/Material Specifications Qty. Remarks
No.

Windows 11, Processor i5


1 Computer System 01
11th gen, 8 GB RAM

Name of Member with Roll No and Enrollment No.

Roll No Enrollment No Name of Member

08 2107760011 Atharv Kailas Jadhav

Approved by

(Prof. Amit P. Bhuse______________)


Name and Signature of Staff

MET’s Institute of Technology, Polytechnic, Nashik 2


Annexure – II
Micro-Project Report

Digital Clock using Swing

1.0. Rationale
Creating a digital clock using Swing in java is an educational and practical exercise that can
enhance your java and GUI programming skills while providing valuable experience in real-
time applications, date and time handling, multithreading and user interface customization
.Its a solid foundation for more advance projects and serves as a demonstration of
programming abilities.
2.0. Aims/Benefits of the Micro-Project

1. Display the current time in hours, minutes and seconds.


2. Design user-friendly interface using swing components.
3. Optionally, display the current date and day of week alongside ethe time.
4. Handle exception and error gracefully.

3.0. Course Outcomes Addressed

a) Develop programs using GUI framework (AWT and Swing). Addressed

b) Handle events of AWT and Swing components. Addressed

c) Develop programs to handle events in Java Programming. Addressed

d) Develop java programs using networking concepts. Not Addressed

e) Develop programs using database. Not Addressed

f) Develop programs using Servlets. Not Addressed

4.0. Literature Review


This Java program creates a graphical user interface (GUI) application for displaying a digital
clock along with the current day and date. Let's break down the program step by

step:

Import Statements:
The program begins with a series of import statements, which bring in the necessary classes
from the Java standard library and Swing library to create a graphical user interface.

MET’s Institute of Technology, Polytechnic, Nashik 3


MyFrame Class:
The MyFrame class extends the JFrame class, which is a top-level container for creating GUI
windows.

Constructor:
The constructor of the MyFrame class is where the GUI is set up and initialized.

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE):
This line sets the close operation for the frame, ensuring that the application will exit when
the window is closed.
setTitle("My Clock Program"): Sets the title of the window.
setLayout(new FlowLayout()): Specifies that the layout manager for the frame is a
FlowLayout, which arranges components in a left-to-right, top-to-bottom manner.
setSize(350, 200): Sets the initial size of the window to 350 pixels in width and 200 pixels in
height.
setResizable(false): Disables window resizing, so the user cannot change the size of the
frame.

Date and Time Formats:


Three SimpleDateFormat objects are created to format the time, day, and date in the
desired way.

Labels:
Three JLabel components (timeLabel, dayLabel, and dateLabel) are created to display the
time, day, and date information.
Fonts and colors are set for these labels.
Adding Components:

The labels are added to the frame using the add() method.

Setting Visibility:
setVisible(true): Makes the frame visible on the screen.

setTime() Method:
This method continuously updates the time, day, and date labels with the current values in a
loop, making the digital clock dynamic.

Inside the loop:

MET’s Institute of Technology, Polytechnic, Nashik 4


The timeFormat, dayFormat, and dateFormat objects are used to format the current time,
day of the week, and date, respectively.
The labels (timeLabel, dayLabel, and dateLabel) are updated with the formatted time, day,
and date.
The program then sleeps for 1000 milliseconds (1 second) to ensure that the time updates
every second.

main() Method:
This is the entry point of the program. It creates an instance of the MyFrame class, which
initializes and displays the GUI window with the digital clock.

5.0. Actual Methodology Followed


Planned
Sr. Planned Name of Responsible
Details of activity Finish
No. Start Date Team Member
Date

Information Gathering and Topic


1
Finalization

Preparing Project Proposal and


2
Approval

3 Implementing Project

4 Preparing Project Report

5 Presenting Project

6 Submission of Project and Report

6.0. Actual Resources Used (Mention the actual resources used)


Sr.
Name of Resource/Material Specifications Qty. Remarks
No.

Windows 11, Processor


1 Computer System 01 -
i5 11th gen, 8 GB RAM

2 Java Development Kit Jdk 10.0.1 01

3 Database Package 01

MET’s Institute of Technology, Polytechnic, Nashik 5


4 Java Programming Editor Eclipse 01

7.0. Output of the Micro-Project

Java code defines a Swing-based digital clock application. When you run this program, it will
create a graphical window displaying a digital clock with the current time, day of the week,
and date, and it will update this information in real-time.

The output of this code will be a graphical user interface (GUI) window that appears on
screen with the following components:
Time Label: A large label at the top of the window displaying the current time in the format
"hh:mm:ss a" (hours:minutes:seconds AM/PM).

Day Label: A label below the time label that shows the current day of the week (e.g.,
"Monday").

Date Label: Another label below the day label displaying the current date in the format
"Month dd, yyyy" (e.g., "November 07, 2023").

The time, day, and date labels will continuously update in real-time, with the time refreshing
every second.

8.0. Skill Developed/Learning outcomes of this Micro-Project


1) Programming skills of Java
2) Designing and building GUI application using Java
3) Design application with the help of swing
4) Debugging, tackling issues related to swing, date formatting.

9.0. Application of this Micro-Project


Desktop Clock Application: You can use the Swing-based digital clock to create a desktop
application that displays the current time on your computer. This can be a convenient way
to have a live clock on your desktop.
Learning and Practice: Developing a digital clock with Swing is an excellent way to learn and
practice GUI programming in Java. It helps you understand how to create and manage
graphical user interfaces, use timers for real-time updates, and work with Swing
components.
Screensaver: You can design a screensaver using Swing and display it on your computer
screen when it's idle. The screensaver could be the digital clock, which would start running
after a certain period of inactivity.

MET’s Institute of Technology, Polytechnic, Nashik 6


MET’s Institute of Technology, Polytechnic, Nashik 7
Annexure - IV
Micro-Project Evaluation Sheet
Name of Student: Atharv Kailas Jadhav Enrollment No: 2107760011

Name of Programme: Computer Engineering Semester: Fifth


Course Title: Advanced Java Programming Code: 22517
Title of the Micro-Project: Digital Clock Using Swing
Course Outcomes Achieved:-
a) Develop programs using GUI framework (AWT and Swing). Achieved

b) Handle events of AWT and Swing components. Achieved

c) Develop programs to handle events in Java Programming. Achieved

d) Develop java programs using networking concepts. Not Achieved

e) Develop programs using database. Not Achieved

f) Develop programs using Servlets. Not Achieved

Sr. Characteristics to be Poor Average Good Excellent Sub-


No. assessed (Marks 1-3) (Marks 4-5) (Marks 6-8) (Marks 9-10) Total

(A) Process and Product Assessment (Convert above total marks out of 6 Marks)

1 Relevance to the course

Literature Review/
2
Information Collection

Completion of the Target


3
as per Project Proposal

Analysis of Data and


4
Representation

Quality of
5
Prototype/Model

6 Report Preparation

(B) Individual Presentation/Viva (Convert above total marks out of 4 Marks)

7 Presentation

MET’s Institute of Technology, Polytechnic, Nashik 8


8 Viva

(A) Process and Product Assessment (B) Individual Presentation/Viva Total Marks

(6 Marks) (4 Marks) (10 Marks)

Comments/Suggestions about team work/leadership/inter-personal communication (if any)

Name and Designation of the Teacher: Prof. Amit P. Bhuse


Dated Signature:
Program Code:
import java.awt.*;
import java.text.*;
import java.util.*;
import javax.swing.*;
public class MyFrame extends JFrame{

Calendar calendar;
SimpleDateFormat timeFormat;
SimpleDateFormat dayFormat;
SimpleDateFormat dateFormat;
JLabel timeLabel;
JLabel dayLabel;
JLabel dateLabel;
String time;
String day;
String date;

MyFrame(){
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setTitle("My Clock Program");
this.setLayout(new FlowLayout());
this.setSize(350,200);
this.setResizable(false);

timeFormat = new SimpleDateFormat("hh:mm:ss a");


dayFormat = new SimpleDateFormat("EEEE");
dateFormat = new SimpleDateFormat("MMMMM dd, yyyy");

timeLabel = new JLabel();


timeLabel.setFont(new Font("Verdana",Font.PLAIN,50));
timeLabel.setForeground(new Color(0x00FF00));
timeLabel.setBackground(Color.black);

MET’s Institute of Technology, Polytechnic, Nashik 9


timeLabel.setOpaque(true);

dayLabel = new JLabel();


dayLabel.setFont(new Font("Ink Free",Font.PLAIN,35));

dateLabel = new JLabel();


dateLabel.setFont(new Font("Ink Free",Font.PLAIN,25));

this.add(timeLabel);
this.add(dayLabel);
this.add(dateLabel);
this.setVisible(true);

setTime();
}

public void setTime() {


while(true) {
time = timeFormat.format(Calendar.getInstance().getTime());
timeLabel.setText(time);

day = dayFormat.format(Calendar.getInstance().getTime());
dayLabel.setText(day);

date = dateFormat.format(Calendar.getInstance().getTime());
dateLabel.setText(date);

try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public static void main(String[] args) {

new MyFrame();
}
}

MET’s Institute of Technology, Polytechnic, Nashik 10

You might also like