0% found this document useful (0 votes)
14 views

A Mini Project Report java (2)

Uploaded by

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

A Mini Project Report java (2)

Uploaded by

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

A Mini Project Report

On
ID Card Generator
Submitted to the SVERI’s College of Engineering,
Pandharpur
In fulfilment of requirements for the award of
degree
Bachelor of Technology
In
Computer Science and Engineering by
PRN NO. Roll No. Name Sign
A55 Ghule Shreyash Balaji
A59 Jadhav Ranveer Pradip
A79 Waydande Tejas Ravindra

DEPARTMENT OF COMPUTER SCIENCE AND


ENGINEERING

SVERI’S COLLEGE OF ENGINEERING

PANDHARPUR

ACADEMIC YEAR:2023-24
DEPARTMENT OF COMPUTER SCIENCE &
ENGINEERING
SVERI’S COLLEGE of ENGINEERING
PANDHARPUR
2023 - 2024

CERTIFICATE

This is to certify that the report entitled ID Card Generator


submitted by A55 Ghule Shreyash Balaji, A59 Jadhav
Ranveer Pradip, A79 Waydande Tejas Ravindra to Sveri’s
College of Engineering Pandharpur.

In partial fulfilment of the B.Tech degree in Computer


Science and Engineering is a bonafide record of the seminar
work carried out by them under our guidance and supervision.
This report in any form has not been submitted to any other
University or Institute for any purpose
Prof.P.D.Mane Prof.P.D.Mane
(Project Guide) (Project
Dept. Of CSE Coordinator)
SVERI’s College of Engineering Assistant Professor
Pandharpur Dept. Of CSE
SVERI’s College of
Engineering
Pandharpur

Dr.Mrs.S.P.Pawar Dr. B. P. Ronge


HOD Of (Principal)
Dept. Of CSE SVERI’s COE,
SVERI’s College of Engineering Pandharpur
Pandharpur

DECLARATION
We A55 Ghule Shreyash Balaji, A59 Jadhav Ranveer Pradip,
A79 Waydande Tejas Ravindra hereby declare that the seminar
report ID Card Generator , submitted for partial fulfilment of the
requirements for the award of degree of Bachelor of Technology
of the SVERI’s College of Engineering, Pandharpur is a bonafide
work done by me under supervision of Prof.P.D.Mane

This submission represents my ideas in our own words and


where ideas or words of others have been included, we have
adequately and accurately cited and reference the original
sources. I also declare that I have adhered to ethics of
academic honesty and integrity and have not misrepresented
or fabricated any data or idea or fact or source in our
submission

I understand that any violation of the above will be a cause


for disciplinary action by the institute and/or the University and
can also evoke penal action from the sources which have thus
not been properly cited or from whom proper permission has
not been obtained. This report has not been previously formed
the basis for the award of any degree, diploma or similar title of
any other University

Pandharpur 1.Ghule
Shreyash Balaji

06-04-2024
2.Jadhav Ranveer Pradip

3.Waydande Tejas Ravindra


Content

Abstract

Acknowledgement

1. Introduction
2. Literature Review
3. Methodology
4. Implementation
5. Result

Conclusion
Abstract
The ID Card Generator project aims to develop a robust
and user-friendly application using Java programming
language that automates the process of generating
identification cards.

This project facilitates the creation of professional-looking


ID cards for various purposes such as educational
institutions, organizations, companies, and events.
Acknowledgement
I take this opportunity to express my deepest sense of gratitude and
sincere thanks to everyone who helped me to complete this work
successfully. I express my sincere thanks to Dr.Mrs.S.P.Pawar, Head of
Department, Computer Science and Engineering SVERI’s College of
Engineering Pandharpur for providing me with all the necessary facilities
and support.

I would like to express my sincere gratitude to Prof.T.A.Dhumal ,


department of Computer Science and Engineering, SVERI’s College of
Engineering Pandharpur for their support and cooperation.

I would like to place on record my gratitude to my seminar guide


Prof.P.D.Mane, Computer Science and Engineering, SVERI’s College of
Engineering for the guidance and mentorship throughout the course.

Finally, I thank my friends who contributed to the successful fulfilment


of this seminar work.
1.Ghule Shreyash Balaji
2.Jadhav Ranveer Pradip
3.Waydande Tejas Ravindra

1. Introduction
Welcome to the Swing-based ID Card Generator project
presentation. In this project, we have developed a user-friendly
Java application utilizing the Swing package to facilitate the
creation of personalized identification cards.

The Swing-based ID Card Generator is a Java application


designed to streamline the process of generating ID cards. By
leveraging the Swing GUI toolkit, we have created an intuitive
interface for users to input essential details such as name,
branch, date of birth, and address.

JAVA Swing : We have utilized the Swing package for


building the graphical user interface, ensuring cross-platform
compatibility and responsiveness

JAVA Programming language : The entire project is


developed using Java, leveraging its robust features and wide
adoption in software development.

Input Window : Users are greeted with an input window


where they can enter their details.

Output Window : After inputting the necessary information


and clicking the "Generate ID Card" button, users are presented
with an output window displaying the generated ID card.
2. Literature Review
In the realm of software development, graphical user
interfaces (GUIs) play a crucial role in enhancing user
experience and usability. The Swing-based ID Card
Generator project leverages Java's Swing package to create
an intuitive interface for generating personalized
identification cards. This literature review examines existing
research and projects related to GUI development in Java,
as well as ID card generation systems.
3. Methodology
1. Requirement Analysis:

 Identify the key requirements and functionalities of the ID


Card Generator application.
 Define the scope of the project, including the input fields,
customization options, and Output format

2. Design:

 Design the graphical user interface (GUI) using Java Swing


components.
 Define the structure of the input form, including text fields,
labels, buttons, and other relevant components.

3. Implementation:

 Develop the GUI components using Java Swing classes and


APIs.
 Implement event handlers to capture user interactions
such as button clicks and text input.
4. Implementation
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.*;

public class StudentIDCard extends JFrame implements ActionListener {


private JTextField collegeNameField;
private BufferedImage photo;
private JTextField studentNameField;
private JTextField branchField;
private JTextField bloodGroupField;
private JTextField dobField;
private JTextField addressField;
private JTextField phoneNumberField;
private JLabel photoLabel;

public StudentIDCard() {
setTitle("Student ID Card");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(500, 600);
setLayout(new GridLayout(11, 2, 10, 10));

add(new JLabel("College Name:"));


collegeNameField = new JTextField();
add(collegeNameField);

add(new JLabel("Student Name:"));


studentNameField = new JTextField();
add(studentNameField);

add(new JLabel("Branch:"));
branchField = new JTextField();
add(branchField);

add(new JLabel("Blood Group:"));


bloodGroupField = new JTextField();
add(bloodGroupField);

add(new JLabel("DOB:"));
dobField = new JTextField();
add(dobField);

add(new JLabel("Address:"));
addressField = new JTextField();
add(addressField);

add(new JLabel("Phone Number:"));


phoneNumberField = new JTextField();
add(phoneNumberField);

JButton browseButton = new JButton("Browse Photo");


browseButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JFileChooser fileChooser = new JFileChooser();
int result = fileChooser.showOpenDialog(null);
if (result == JFileChooser.APPROVE_OPTION) {
File selectedFile = fileChooser.getSelectedFile();
try {
photo = ImageIO.read(selectedFile);
displayPhoto(photo);
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
});
add(browseButton);

JButton generateButton = new JButton("Generate ID Card");


generateButton.addActionListener(this);
add(generateButton);

photoLabel = new JLabel();


add(photoLabel);

setVisible(true);
}

public void displayPhoto(BufferedImage img) {


photoLabel.setIcon(new ImageIcon(img.getScaledInstance(150, 200,
Image.SCALE_SMOOTH)));
}

@Override
public void actionPerformed(ActionEvent e) {
// Generate ID card
String collegeName = collegeNameField.getText();
String studentName = studentNameField.getText();
String branch = branchField.getText();
String bloodGroup = bloodGroupField.getText();
String dob = dobField.getText();
String address = addressField.getText();
String phoneNumber = phoneNumberField.getText();

// Display ID card information


IDCardDisplay idCardDisplay = new IDCardDisplay(collegeName, photo,
studentName, branch, bloodGroup, dob, address, phoneNumber);
idCardDisplay.setVisible(true);
}

public static void main(String[] args) {


new StudentIDCard();
}
}

class IDCardDisplay extends JFrame {


private String collegeName;
private BufferedImage photo;
private String studentName;
private String branch;
private String bloodGroup;
private String dob;
private String address;
private String phoneNumber;

public IDCardDisplay(String collegeName, BufferedImage photo, String studentName,


String branch,
String bloodGroup, String dob, String address, String phoneNumber) {
this.collegeName = collegeName;
this.photo = photo;
this.studentName = studentName;
this.branch = branch;
this.bloodGroup = bloodGroup;
this.dob = dob;
this.address = address;
this.phoneNumber = phoneNumber;

setTitle("Generated ID Card");
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setSize(400, 600);
setLayout(new BorderLayout());

JPanel panel = new JPanel();


panel.setLayout(new GridLayout(9, 1, 5, 5));

JLabel collegeLabel = new JLabel(collegeName);


collegeLabel.setFont(new Font(collegeLabel.getFont().getName(), Font.BOLD, 16));
// Make font bold and increase size
panel.add(collegeLabel);

JLabel photoLabel = new JLabel(new ImageIcon(photo.getScaledInstance(150, 200,


Image.SCALE_SMOOTH)));
panel.add(photoLabel);

panel.add(new JLabel("Student Name: " + studentName));


panel.add(new JLabel("Branch: " + branch));
panel.add(new JLabel("Blood Group: " + bloodGroup));
panel.add(new JLabel("DOB: " + dob));
panel.add(new JLabel("Address: " + address));
panel.add(new JLabel("Phone Number: " + phoneNumber));
add(panel, BorderLayout.CENTER);

JButton saveButton = new JButton("Save ID Card");


saveButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
saveIDCard();
}
});
add(saveButton, BorderLayout.SOUTH);
}

private void saveIDCard() {


BufferedImage idCardImage = new BufferedImage(getWidth(), getHeight(),
BufferedImage.TYPE_INT_RGB);
paint(idCardImage.getGraphics());

JFileChooser fileChooser = new JFileChooser();


fileChooser.setDialogTitle("Save ID Card");
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
int result = fileChooser.showSaveDialog(this);
if (result == JFileChooser.APPROVE_OPTION) {
File file = fileChooser.getSelectedFile();
if (!file.getName().toLowerCase().endsWith(".jpg")) {
file = new File(file.getParentFile(), file.getName() + ".jpg");
}
try {
ImageIO.write(idCardImage, "jpg", file);
JOptionPane.showMessageDialog(this, "ID Card saved successfully!");
} catch (IOException ex) {
ex.printStackTrace();
JOptionPane.showMessageDialog(this, "Error saving ID Card", "Error",
JOptionPane.ERROR_MESSAGE);
}
}
}
}
5.Result/Output
6. Conclusion
The "ID Card Generate" Java project utilizes Swing for a
user-friendly interface to generate customized ID cards. Users
input crucial details like name, branch, blood group, and date of
birth, swiftly generating personalized cards. Stringent input
validation ensures data integrity, while error handling enhances
user experience. Customization features enable users to tailor
the appearance of ID cards to their preferences.
Comprehensive documentation and rigorous testing guarantee
reliability and ease of use. Overall, "ID Card Generate" is an
efficient tool for creating ID cards, suitable for various
applications
7. Reference
https://chat.openai.com/

https://www.javatpoint.com/java-tutorial

https://www.w3schools.com/java/

You might also like