AJP Microproject
AJP Microproject
1. Report
1.1) Abstract
1.2) Title
1.3) Introduction
1|Pa ge
Employee Management System Ashokrao Mane Polytechnic
2 Notepad Editor 1 -
3 Internet Google - -
Organize ideas in systematic, Logical and Coherent Manner. It helps me to deal with the
errors. It’s also helps me to get knowledge to event handling and solve the problems in Java
Programming. This Micro Project is expected to develop Employee Management System. The
output of the program is attached at the end of this project.
2|Pa ge
Employee Management System Ashokrao Mane Polytechnic
2.1) Algorithm
Step 1 :- Start
Step 2:- Display the main menu with the following options:
1) Create Employee
2) Update Employee
3) Delete Employee
4) Exit
Step 3:- Based on the user’s choice, perform the following actions:
Option 1: Create Employee
Input the new employee details ( Name, Employee ID, Department, Designation,
Contact Info, etc.)
Validate the input ensure that all required fields are filled.
Save employee details to the database using an SQL INSERT query.
Display a success message: "Employee added successfully."
Option 2: Update Employee
Input the Employee ID of the employee to be updated.
Fetch the existing record from the database. If the record does not exist, display an
error message and return to step 4.
Display the current details and prompt the user for updated values.
Validate the updated data.
Save the changes to the database using an SQL UPDATE query.
Display a success message: "Employee updated details successfully."
Option 3: Delete Employee
Input the Employee ID of the employee to be deleted.
Check if the record exists in the database. If the record does not exist, display an
error message and return to step 4.
Delete the employee record using an SQL DELETE query.
Display a success message: "Employee details deleted successfully."
Option 4: Exit
Terminate the program.
Step 4:- Return to the main menu (step 2) after completing any operation.
Step 5:- End
3|Pa ge
Employee Management System Ashokrao Mane Polytechnic
2.1) Flowchart
Start
Main Menu
Option 4 Exit
End
4|Pa ge
Employee Management System Ashokrao Mane Polytechnic
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
import java.util.List;
// Constructor
public EmployeeManagementSystem() {
setTitle("Employee Management System");
setSize(600, 400);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
mainPanel.add(getWelcomePage(), "Welcome");
mainPanel.add(getCreateEmployeePage(), "Create");
mainPanel.add(getUpdateEmployeePage(), "Update");
mainPanel.add(getDeleteEmployeePage(), "Delete");
add(mainPanel);
setVisible(true);
}
// Welcome Page
private JPanel getWelcomePage() {
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
5|Page
Employee Management System Ashokrao Mane Polytechnic
buttonPanel.add(createBtn);
buttonPanel.add(updateBtn);
buttonPanel.add(deleteBtn);
panel.add(buttonPanel, BorderLayout.SOUTH);
return panel;
}
6|Page
Employee Management System Ashokrao Mane Polytechnic
panel.add(nameLabel);
panel.add(nameField);
panel.add(idLabel);
panel.add(idField);
panel.add(addressLabel);
panel.add(addressField);
panel.add(saveBtn);
panel.add(backBtn);
saveBtn.addActionListener(e -> {
String name = nameField.getText();
String id = idField.getText();
String address = addressField.getText();
7|Page
Employee Management System Ashokrao Mane Polytechnic
panel.add(idLabel);
panel.add(idField);
panel.add(nameLabel);
panel.add(nameField);
panel.add(addressLabel);
panel.add(addressField);
panel.add(updateBtn);
panel.add(backBtn);
updateBtn.addActionListener(e -> {
String id = idField.getText();
String newName = nameField.getText();
String newAddress = addressField.getText();
8|Page
Employee Management System Ashokrao Mane Polytechnic
panel.add(idLabel1);
panel.add(idLabel2);
panel.add(idLabel);
panel.add(idField);
panel.add(idLabel3);
panel.add(idLabel4);
panel.add(deleteBtn);
panel.add(backBtn);
deleteBtn.addActionListener(e -> {
String id = idField.getText();
for (Employee emp : employees) {
if (emp.getId().equals(id)) {
employees.remove(emp);
JOptionPane.showMessageDialog(this, "Employee details deleted successfully!");
return;
}
} JOptionPane.showMessageDialog(this, "Employee with ID not found.");
});
9|Page
Employee Management System Ashokrao Mane Polytechnic
// Employee Class
class Employee {
private String name;
private String id;
private String address;
public Employee(String name, String id, String address) {
this.name = name;
this.id = id;
this.address = address;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}
10 | P a g e
Employee Management System Ashokrao Mane Polytechnic
3. Output of microproject
3.1) Output
11 | P a g e
Employee Management System Ashokrao Mane Polytechnic
4. Conclusion
The Employee Management System developed using Advanced Java offers an efficient,
scalable, and secure solution for managing employee records and streamlining organizational
processes. By incorporating features such as dynamic content handling, database integration,
and user role management, the system simplifies complex tasks like adding, updating, and
deleting employee information. This system not only reduces manual effort but also
minimizes errors and ensures data consistency across operations.
12 | P a g e