Final Clothing Store Management Report
Final Clothing Store Management Report
PROJECT REPORT
(Term June-August 2025)
Submitted By
i
CERTIFICATE
ii
Acknowledgement
I would like to express my deep gratitude to Lovely Professional University for giving me the valuable
opportunity to undergo summer training and work on the project titled “Clothing Store Management
System.”
I am especially thankful to my project guide, Mr. Sarvesh Chopra, for his insightful guidance, timely
feedback, and continuous encouragement throughout the development of this project. His mentorship
played a crucial role in shaping my learning experience.
I sincerely appreciate the Department of Computer Science and Engineering for fostering a learning
environment that encouraged creativity, technical exploration, and practical application of knowledge.
I would also like to extend my thanks to my fellow students and friends who offered support, suggestions,
and motivation during different phases of this project.
Lastly, I am deeply thankful to my family for their patience, inspiration, and unwavering support
throughout the training period.
This summer training has greatly enhanced my practical understanding of Java programming and
database management, and I am confident it will serve as a strong foundation for my future endeavors.
Aman Saxena
B.Tech – Computer Science and Engineering
Lovely Professional University
iii
Table of Contents
Chapter 1: Introduction ........................................................................................................... 1
1.1 University Introduction................................................................................................................................. 1
1.2 Overview of training domain ....................................................................................................................... 1
1.3 Objective of the project ................................................................................................................................ 1
iv
CHATER 1: INTRODUCTION
1.1 University introduction
Lovely Professional University (LPU), one of India’s top private institutions, is committed to
fostering academic excellence and practical learning. Through initiatives like summer training
programs, LPU equips students with the technical and project development skills necessary for
real-world success. The Clothing Store Management System project was undertaken as part of
this initiative to bridge theoretical knowledge with software implementation practices.
The training program centered around desktop application development using Java and
MySQL. Java, with its strong object-oriented capabilities and platform independence,
combined with MySQL, a robust open-source relational database system, provided the
technical foundation for this project. The major areas of learning included:
• CRUD operations
This domain is crucial for developing enterprise-level applications like ERP systems, POS
systems, and inventory management software.
The core objective of this project is to build a Java-based desktop application named "Clothing
Store Management System" which enables inventory and user management for a retail clothing
store. The solution simulates key operations of a retail system such as:
▪ Providing secure login functionality with password masking and
attempt limits
▪ Enabling CRUD operations on product records (add, view, update,
delete)
▪ Allowing user registration and password reset functionalities
▪ Incorporating real-time product search and inventory alerts
▪ Maintaining detailed logs of actions and transactions
▪ Providing a user-friendly and responsive GUI using Java Swing
This project consolidates the skills acquired during training and provides a practical
demonstration of using Java and MySQL for developing real-world business software
applications.
2
CHAPTER 2: TRAINING OVERVIEW
2.1 TOOLS AND TECHNOLOGY USED
During the training, the following tools and technologies were used to build the Clothing Store
Management System :
Tool/Technology Description
Core programming language used for building
Java (JDK 8+)
the entire application logic.
Used to create the Graphical User Interface
Java Swing
(GUI) for the system.
Open-source relational database used to store
MySql
users, products, and sales.
Used to connect Java applications with the
JDBC
MySQL database.
Throughout the summer training program, the following key areas were covered:
3
2.3 DAILY AND WEEKLY WORK SUMMARY
4
CHAPTER 3: PROJECT DETAILS
3.1 TITLE OF THE PROJECTS
Managing a clothing store manually can be inefficient, error-prone, and time-consuming. Tasks
such as tracking inventory, registering users, securing login credentials, updating stock, and
logging user activities become difficult to manage without an automated system.
The absence of an integrated software solution leads to issues such as inconsistent stock records,
unauthorized access, delayed customer service, and lack of transaction tracking.
Hence, there is a need for a comprehensive Clothing Store Management System that automates
product management, supports secure user authentication, logs application events, and offers a
user-friendly interface to improve efficiency and accuracy in retail operations.
5
• Offering low-stock alerts and real-time search to support better inventory decisions.
• Providing a user-friendly GUI for ease of operation by both new and experienced users.
3.3.2 OBJECTIVES
• Implement secure login functionality with registration and password reset options
• Log important events such as user actions, logins, and errors using Java Logging API for
auditing and debugging
These objectives were designed to ensure the project aligned with real-world retail software
needs while reinforcing core programming concepts.
6
3.4 SYSTEM REQUIREMENTS
3.4.1 HARDWARE REQUIREMENTS
RAM 4 GB or higher
Component Description
7
3.5 DATAFLOW
8
CHAPTER 4: IMPLEMENTATION
4.1 METHODOLOGY
We followed the modular programming approach and object-oriented design principles. The
project was broken down into distinct components including:
• User Authentication
• Product Management
Methodology Diagram
9
4.1.1 Thread Handling
To ensure smooth user experience and prevent the GUI from freezing during time-
consuming operations (such as log file access or database queries), the project uses basic
thread handling mechanisms provided by Java. For example:
This threading approach supports a more efficient and user-friendly system, especially
when managing file I/O and database tasks.
4.2 MODULES
The login module is responsible for user authentication, allowing only authorized users to
access the system. It supports the following functionalities:
• Username and password validation using data stored in the MySQL database.
• Forgot password feature that allows password reset after verifying the username.
• User registration module for new users with password confirmation validation.
• All login activities (success or failure) are logged using Java Logging API for monitoring
and auditing.
10
This module ensures secure access and establishes the user context for accessing other
modules in the application.
11
Figure 1.1.2 Login Successful.
12
Figure 1.1.5 Enter Username for New Password
13
Figure 1.1.8 Attempts 1
14
4.2.2 Admin Dashboard
The Admin Dashboard serves as the central control panel for managing inventory-related
tasks within the Clothing Store Management System. Upon successful login, the user
(admin) is redirected to the main interface (StoreFrame) that functions as the dashboard.
This interface allows the administrator to interact with the core functionalities of the
application through an intuitive GUI built with Java Swing.
Key Functionalities of the Admin Dashboard:
• Product Management: The admin can perform all CRUD (Create, Retrieve, Update,
Delete) operations on product data. Product fields include ID, name, category, quantity,
and price. These actions are handled through dedicated buttons and text fields.
• Search and Filter: A real-time search feature enables the admin to look up products by ID,
name, or price. The results are displayed dynamically in a JTable.
• Log Viewer: A "View Logs" button allows the admin to access the application log file.
This feature uses Java's Desktop.getDesktop().open() method to open the log file created
by the AppLogger utility. The log file records all significant events such as logins,
product changes, and system warnings.
• Low-Stock Alerts: During data retrieval, the system checks inventory levels and
automatically notifies the admin of any product whose stock is below the predefined
threshold (e.g., quantity < 5). This helps in proactive stock management.
• UI Navigation and Usability: Buttons like “Clear” and “Exit” help streamline workflow.
All actions are executed in real time with visual feedback via JOptionPane dialogues.
Security and Logging:
• All actions performed on this dashboard (e.g., product creation, update, deletion, and
search) are logged using the Java Logging API (AppLogger). This provides traceability
and accountability for administrative operations.
This module reflects core principles of usability, modularity, and maintainability while
offering complete control over the inventory management lifecycle.
15
Figure 2 Admin Dashboard
16
Figure 2.1.2 Product Added successfully.
17
Figure 2.1.5 Product Quantity Updated.
18
Figure 2.1.7 Product vivo phone Deleted Successfully.
19
4.2.3 System Logs
The System Logs module ensures that all major events within the application are
persistently recorded. Logging is handled by the AppLogger utility, which uses
Java's built-in Logging API to write entries into a date-wise .log file.
Key Features:
• Captures login attempts, both successful and failed, by users including time and
username.
• Logs product operations such as add, update, and delete actions by the admin.
• Allows the admin to view log files through the dashboard using system file open
feature.
20
4.2.4 Inventory Management Module
This module provides comprehensive inventory tracking and product control features that are
accessible to the admin.
• Inventory levels are constantly monitored, and low-stock alerts are generated.
21
CHAPTER 5: RESULT AND DISCUSSION
5.1 OUTPUT/REPORT
The final output of the Clothing Store Management System achieved the key project goals:
• Login Module: Secure login, registration, and password recovery features function as expected.
• Admin Dashboard: The administrator can add, update, delete, and search products. Log files can
be opened and reviewed. Low stock alerts assist in inventory decision-making.
• Logging System: All key user actions, such as logins and inventory updates, are recorded in
timestamped log files using Java Logging API.
• Database Connectivity Issues: JDBC driver configuration required careful matching between
Java and MySQL versions.
• Swing UI Alignment: Creating a responsive and organized interface layout across screen sizes
took effort.
• Role-based Access: Implementing access controls and UI differences based on login roles
(admin vs others) added extra logic.
• Log Synchronization: Ensuring logs are written only after successful DB operations required
precise handling.
5.3 LEARNINGS
Through this project, several technical and professional skills were developed:
• Practical use of Java Swing for desktop application design
• Use of JDBC for database operations with MySQL
• Hands-on application of CRUD techniques and user input handling
• Modular design using object-oriented programming
• Logging and monitoring via Java Logging API
• Debugging complex UI and DB workflows
22
CHAPTER 6: CONCLUSION
SUMMARY
The Clothing Store Management System developed as part of the summer training
successfully meets the core objectives of enabling secure login, product inventory control,
and activity logging.
Built using Java Swing and MySQL, the application demonstrates effective use of object-
oriented principles, JDBC database connectivity, and real-time inventory control. With a
focus on modularity and logging, it helps simulate a basic retail environment.
Key Features Achieved:
• Secure login with registration and forgot password
• CRUD-based inventory operations for admin
• Inventory alerts for low stock
• Log file creation and viewing for audits
The project enabled practical application of training concepts and serves as a strong
foundation for enhancements like billing features, cashier-specific dashboards, and sales
analytics in future versions.
7. CODING SECTION
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
23
String url = "jdbc:mysql://localhost:3306/clothing_store";
String dbUser = "root";
String dbPassword = "Engineer@#4599";
int attempts = 0;
final int MAX_ATTEMPTS = 3;
public LoginFrame() {
setTitle("Login - Clothing Store");
setSize(350, 300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
panel.add(new JLabel("Username:"));
panel.add(usernameField);
panel.add(new JLabel("Password:"));
JPanel passPanel = new JPanel(new BorderLayout());
passPanel.add(passwordField, BorderLayout.CENTER);
passPanel.add(showPasswordCheckBox, BorderLayout.EAST);
panel.add(passPanel);
panel.add(loginButton);
24
panel.add(forgotPasswordBtn);
panel.add(new JLabel());
panel.add(messageLabel);
add(panel);
loginButton.addActionListener(this);
forgotPasswordBtn.addActionListener(e -> forgotPassword());
registerBtn.addActionListener(e -> registerUser());
showPasswordCheckBox.addActionListener(e -> {
passwordField.setEchoChar(showPasswordCheckBox.isSelected() ? (char) 0 :
'\u2022');
});
}
@Override
public void actionPerformed(ActionEvent e) {
String username = usernameField.getText().trim();
String password = new String(passwordField.getPassword());
if (username.isEmpty() || password.isEmpty()) {
JOptionPane.showMessageDialog(this, "Please fill both fields!", "Warning",
JOptionPane.WARNING_MESSAGE);
return;
}
if (authenticate(username, password)) {
AppLogger.getLogger().info("Login successful for user: " + username);
JOptionPane.showMessageDialog(this, " Login Successful!");
25
StoreFrame frame = new StoreFrame();
frame.setSize(700, 600);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
} else {
attempts++;
AppLogger.getLogger().warning("Failed login attempt for user: " + username + "
(Attempt " + attempts + ")");
if (attempts >= MAX_ATTEMPTS) {
JOptionPane.showMessageDialog(this, " Too many failed attempts. Exiting.");
System.exit(0);
} else {
JOptionPane.showMessageDialog(this, " Invalid Username or
Password\nAttempts: " + attempts + "/" + MAX_ATTEMPTS, "Login Failed",
JOptionPane.ERROR_MESSAGE);
}
}
}
stmt.setString(1, username);
stmt.setString(2, password);
ResultSet rs = stmt.executeQuery();
return rs.next();
checkStmt.setString(1, username.trim());
ResultSet rs = checkStmt.executeQuery();
if (rs.next()) {
String newPassword = JOptionPane.showInputDialog(this, "Enter your new
password:");
if (newPassword == null || newPassword.trim().isEmpty()) {
JOptionPane.showMessageDialog(this, " Password cannot be empty.");
return;
}
if (updated > 0) {
AppLogger.getLogger().info("Password updated for user: " + username);
JOptionPane.showMessageDialog(this, " Password updated successfully!");
} else {
JOptionPane.showMessageDialog(this, " Failed to update password.");
}
27
} else {
JOptionPane.showMessageDialog(this, " Username not found.");
}
if (result == JOptionPane.OK_OPTION) {
String uname = newUserField.getText().trim();
String pass = new String(newPassField.getPassword()).trim();
String confirm = new String(confirmPassField.getPassword()).trim();
if (!pass.equals(confirm)) {
JOptionPane.showMessageDialog(this, " Passwords do not match!");
return;
}
checkStmt.setString(1, uname);
ResultSet rs = checkStmt.executeQuery();
if (rs.next()) {
JOptionPane.showMessageDialog(this, " Username already exists!");
return;
}
29
public static void main(String[] args) {
AppLogger.setupLogger(); // Initialize logger before anything else
SwingUtilities.invokeLater(() -> {
AppLogger.getLogger().info("LoginFrame launched");
new LoginFrame().setVisible(true);
});
}
}
class StoreAppMain {
public static void main(String args[]) {
AppLogger.setupLogger(); // Initialize logger
StoreFrame frame = new StoreFrame();
frame.setSize(700, 600);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
30
String url = "jdbc:mysql://localhost:3306/clothing_store";
String user = "root";
String pass = "Engineer@#4599";
public StoreFrame() {
setTitle(" Clothing Store Management System");
setLayout(new BorderLayout());
add(inputPanel, BorderLayout.NORTH);
31
table = new JTable(model);
JScrollPane scrollPane = new JScrollPane(table);
add(scrollPane, BorderLayout.CENTER);
buttonPanel.add(createBtn);
buttonPanel.add(retrieveBtn);
buttonPanel.add(updateBtn);
buttonPanel.add(deleteBtn);
buttonPanel.add(clearBtn);
buttonPanel.add(exitBtn);
buttonPanel.add(viewLogsBtn);
add(buttonPanel, BorderLayout.SOUTH);
add(searchPanel, BorderLayout.WEST);
32
updateBtn.addActionListener(e -> updateProduct());
deleteBtn.addActionListener(e -> deleteProduct());
clearBtn.addActionListener(e -> clearFields());
exitBtn.addActionListener(e -> dispose());
searchBtn.addActionListener(e -> searchProducts());
viewLogsBtn.addActionListener(e -> openLogFile());
}
void openLogFile() {
try {
String logFileName = AppLogger.getCurrentLogFileName();
File logFile = new File(logFileName);
if (logFile.exists()) {
Desktop.getDesktop().open(logFile);
} else {
JOptionPane.showMessageDialog(this, "Log file not found.");
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(this, "Error opening log file: " + ex.getMessage());
}
}
void createProduct() {
try (Connection con = DriverManager.getConnection(url, user, pass)) {
if (tf1.getText().isEmpty() || tf2.getText().isEmpty() || tf4.getText().isEmpty() ||
tf5.getText().isEmpty()) {
JOptionPane.showMessageDialog(this, "Please fill all fields!", "Warning",
JOptionPane.WARNING_MESSAGE);
return;
}
int id = Integer.parseInt(tf1.getText());
String name = tf2.getText();
String category = categoryBox.getSelectedItem().toString();
int qty = Integer.parseInt(tf4.getText());
33
float price = Float.parseFloat(tf5.getText());
void retrieveProducts() {
model.setRowCount(0);
try (Connection con = DriverManager.getConnection(url, user, pass);
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM products")) {
float totalValue = 0;
while (rs.next()) {
int qty = rs.getInt("quantity");
float price = rs.getFloat("price");
totalValue += qty * price;
model.addRow(new Object[]{
rs.getInt("product_id"),
34
rs.getString("product_name"),
rs.getString("category"),
qty,
price
});
if (qty < 5) {
JOptionPane.showMessageDialog(this, " Low Stock Alert: " +
rs.getString("product_name"), "Stock Warning", JOptionPane.WARNING_MESSAGE);
}
}
JOptionPane.showMessageDialog(this, " Total Inventory Value: ₹" + totalValue);
AppLogger.getLogger().info("Products retrieved. Total value: ₹" + totalValue);
} catch (Exception ex) {
JOptionPane.showMessageDialog(this, " Error: " + ex.getMessage());
AppLogger.getLogger().warning("Error retrieving products: " + ex.getMessage());
}
}
void updateProduct() {
try (Connection con = DriverManager.getConnection(url, user, pass)) {
if (tf6.getText().isEmpty()) {
JOptionPane.showMessageDialog(this, "Enter Product ID to update", "Warning",
JOptionPane.WARNING_MESSAGE);
return;
}
void deleteProduct() {
try (Connection con = DriverManager.getConnection(url, user, pass)) {
if (tf6.getText().isEmpty()) {
JOptionPane.showMessageDialog(this, "Enter Product ID to delete", "Warning",
JOptionPane.WARNING_MESSAGE);
return;
}
int id = Integer.parseInt(tf6.getText());
String query = "DELETE FROM products WHERE product_id=?";
PreparedStatement stmt = con.prepareStatement(query);
stmt.setInt(1, id);
int deleted = stmt.executeUpdate();
JOptionPane.showMessageDialog(this, deleted > 0 ? " Product deleted!" : " No
product found.");
36
AppLogger.getLogger().info("Product deleted: ID " + id);
retrieveProducts();
} catch (Exception ex) {
JOptionPane.showMessageDialog(this, " Error: " + ex.getMessage());
AppLogger.getLogger().warning("Error deleting product: " + ex.getMessage());
}
}
void searchProducts() {
String searchTerm = searchField.getText().trim().toLowerCase();
if (searchTerm.isEmpty()) {
retrieveProducts();
return;
}
model.setRowCount(0);
try (Connection con = DriverManager.getConnection(url, user, pass)) {
PreparedStatement stmt;
if (searchTerm.matches("\\d+")) {
stmt = con.prepareStatement("SELECT * FROM products WHERE product_id = ?
OR price = ?");
stmt.setInt(1, Integer.parseInt(searchTerm));
stmt.setFloat(2, Float.parseFloat(searchTerm));
} else if (searchTerm.matches("\\d+\\.\\d+")) {
stmt = con.prepareStatement("SELECT * FROM products WHERE price = ?");
stmt.setFloat(1, Float.parseFloat(searchTerm));
} else {
stmt = con.prepareStatement("SELECT * FROM products WHERE
LOWER(product_name) LIKE ?");
stmt.setString(1, "%" + searchTerm + "%");
}
ResultSet rs = stmt.executeQuery();
37
while (rs.next()) {
model.addRow(new Object[]{
rs.getInt("product_id"),
rs.getString("product_name"),
rs.getString("category"),
rs.getInt("quantity"),
rs.getFloat("price")
});
}
AppLogger.getLogger().info("Search performed for: " + searchTerm);
} catch (Exception ex) {
JOptionPane.showMessageDialog(this, " Error: " + ex.getMessage());
AppLogger.getLogger().warning("Search error: " + ex.getMessage());
}
}
void clearFields() {
tf1.setText(""); tf2.setText(""); tf4.setText("");
tf5.setText(""); tf6.setText(""); searchField.setText("");
model.setRowCount(0);
JOptionPane.showMessageDialog(this, " All fields cleared!");
AppLogger.getLogger().info("Fields cleared.");
}
}
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.FileHandler;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
38
public class AppLogger {
private static final Logger appLog = Logger.getLogger("CRUDAppLogger");
private static FileHandler fh;
appLog.addHandler(fh);
appLog.setUseParentHandlers(false);
appLog.info("Logger initialized for session.");
} catch (IOException e) {
e.printStackTrace();
appLog.warning("Failed to set up file logger: " + e.getMessage());
appLog.setUseParentHandlers(true);
}
}
39