0% found this document useful (0 votes)
7 views14 pages

B Merged

The document is a project report for a Car Showroom Management System developed using Java Swing, aimed at simulating basic functionalities such as user authentication, inventory management, and bill generation. It outlines the objectives, technology stack, and core features of the application, which is designed for educational purposes and can be extended for more complex systems. The report includes code snippets, screenshots, and references for further reading.
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)
7 views14 pages

B Merged

The document is a project report for a Car Showroom Management System developed using Java Swing, aimed at simulating basic functionalities such as user authentication, inventory management, and bill generation. It outlines the objectives, technology stack, and core features of the application, which is designed for educational purposes and can be extended for more complex systems. The report includes code snippets, screenshots, and references for further reading.
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/ 14

VISVESVARAYATECHNOLOGICALUNIVERSITY

BELAGAVI-590018, KARNATAKA.

A PROJECT REPORT
On

“CAR SHOWROOM SYSTEM”


Submitted in Partial Fulfillment of the Requirements for

“ADVANCED JAVA (BCS613D) - VI Semester”

For the Award of the Degree


BACHELOR OF ENGINEERING
In
COMPUTER SCIENCE& ENGINEERING
Submitted By:
Bindushree E 1SG22CS018

Under the Guidance of


Prof. Sheela Rani C M
AssistantProfessor

DepartmentofComputerScienceandEngineering
(AccreditedbyNBA)
SAPTHAGIRICOLLEGEOFENGINEERING
(AffiliatedtoVisvesvarayaTechnologicalUniversity,Belagavi&ApprovedbyAICTE,NewDelhi.)
ISO9001-2015&14001-2015Certified,AccreditedbyNAACwith‘A’Grade
14/5,Chikkasandra,HesarghattaMainRoad Bengaluru
– 560057.
2024-2025
ABSTRACT

This project presents a Java Swing-based application designed to simulate the basic functionalities of a car
showroom management system. The application features a graphical user interface (GUI) that includes user
authentication, inventory display, car addition, and bill generation for available cars. Upon launching the
application, users are prompted to log in through a secure login screen. Once authenticated, users are
directed to a dashboard containing two main sections: an inventory panel displaying a list of cars with their
details (ID, model, price, status), and an add car panel where new car entries can be input. The inventory
table allows users to select an available car and generate a purchase bill. While the current implementation
demonstrates core functionality, it can be extended to support persistent storage and dynamic data
management. This application serves as a foundational model for more complex automotive dealership
systems and demonstrates the capabilities of Java Swing for building user-friendly desktop applications.
TABLE OF CONTENTS

Sl. No Contents Pg. No

1 Introduction 1

2 Code 4

3 Screenshots 9

4 References 11
CAR SHOWROOM SYSTEM

INTRODUCTION

In today’s digital age, efficient software solutions are essential for streamlining business operations and
improving customer experience. Car showrooms, which involve managing a variety of vehicles, handling
customer inquiries, and processing purchases, can benefit greatly from computerized systems. This project
presents a desktop-based Car Showroom Management System developed using Java Swing, a part of Java’s
Foundation Classes for building graphical user interfaces.[1]

The system is designed to provide an intuitive and functional interface for managing a showroom’s inventory.
It offers essential features such as user login authentication, a real-time inventory display, a form for adding
new cars, and the ability to generate purchase bills for available vehicles. The use of Java Swing ensures a
responsive and interactive GUI, making the application user-friendly and easy to navigate.[2]

This application aims to simulate a basic showroom environment suitable for educational purposes or as a
prototype for more comprehensive dealership software. Although it currently uses in-memory data and lacks
persistent storage, its modular design allows for future enhancements like database integration and advanced
user roles.[3]

Dept. of CSE, SCE 2024-25 1


CAR SHOWROOM SYSTEM

Objectives

The primary objectives of the Car Showroom Management System developed using Java Swing are as follows:

1. To create a user-friendly graphical interface that allows showroom staff to interact with the system
efficiently.
2. To implement a secure login system to restrict access to authorized users only.
3. To provide an organized view of car inventory, displaying details such as model, price, and
availability.
4. To enable the addition of new cars to the showroom inventory through a simple form-based interface.
5. To implement a bill generation feature for available cars, simulating the purchase process.
6. To demonstrate the capabilities of Java Swing in building desktop applications with real-world
relevance.
7. To build a modular and extensible system that can be enhanced with features like database
integration or customer management in the future.[4]

Dept. of CSE, SCE 2024-25 2


CAR SHOWROOM SYSTEM

Technology Stack

 Programming Language:
Java – Used as the core programming language for implementing the application logic and user
interface.
 GUI Framework:
Java Swing – A part of Java Foundation Classes (JFC) used for creating the graphical user interface
(GUI), including frames, panels, buttons, text fields, tables, and dialogs.
 Development Environment:
Any Java-supported IDE such as IntelliJ IDEA, Eclipse, or NetBeans can be used for development
and testing.
 JDK (Java Development Kit):
Java SE Development Kit (JDK 8 or higher) – Required to compile and run Java Swing applications.
 Operating System:
Platform-independent – The application can run on any operating system that supports Java
(Windows, macOS, Linux).[5]

Dept. of CSE, SCE 2024-25 3


CAR SHOWROOM SYSTEM

CODE
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;

public class CarShowroomApp {


public static void main(String[] args) {
SwingUtilities.invokeLater(() -> new LoginScreen());
}
}

class LoginScreen extends JFrame {


private JTextField usernameField;
private JPasswordField passwordField;

public LoginScreen() {
setTitle("Login - Car Showroom");
setSize(300, 160);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);

JPanel panel = new JPanel(new GridLayout(3, 2));


panel.add(new JLabel("Username:"));
usernameField = new JTextField();
panel.add(usernameField);

panel.add(new JLabel("Password:"));
passwordField = new JPasswordField();
panel.add(passwordField);

JButton loginBtn = new JButton("Login");


loginBtn.addActionListener(e -> authenticate());
panel.add(loginBtn);

Dept. of CSE, SCE 2024-25 4


CAR SHOWROOM SYSTEM

add(panel);
setVisible(true);
}

private void authenticate() {


String user = usernameField.getText();
String pass = new String(passwordField.getPassword());

if (user.equals("admin") && pass.equals("admin")) {


dispose();
new Dashboard();
} else {
JOptionPane.showMessageDialog(this, "Login Failed");
}
}
}

class Dashboard extends JFrame {


public Dashboard() {
setTitle("Car Showroom Dashboard");
setSize(700, 500);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);

JTabbedPane tabs = new JTabbedPane();


tabs.add("Inventory", new InventoryPanel());
tabs.add("Add Car", new AddCarPanel());

add(tabs);
setVisible(true);
}
}

class InventoryPanel extends JPanel {


private JTable carTable;

Dept. of CSE, SCE 2024-25 5


CAR SHOWROOM SYSTEM

private JButton generateBillButton;


private String[][] data;

public InventoryPanel() {
setLayout(new BorderLayout());

data = new String[][]{


{"1", "Nissan Altima", "$22,000", "Available"},
{"2", "Ford Mustang", "$45,000", "Sold"},
{"3", "Toyota Corolla", "$18,000", "Available"},
{"4", "Honda Civic", "$20,500", "Available"},
{"5", "Chevrolet Camaro", "$38,000", "Sold"},
{"6", "Hyundai Elantra", "$17,500", "Available"},
{"7", "BMW 3 Series", "$41,000", "Available"},
{"8", "Audi A4", "$39,000", "Sold"},
{"9", "Mercedes C-Class", "$43,500", "Available"},
{"10", "Kia Forte", "$16,000", "Available"},
{"11", "Mazda 6", "$25,000", "Sold"},
{"12", "Volkswagen Jetta", "$19,000", "Available"},
{"13", "Subaru Impreza", "$22,500", "Available"},
{"14", "Tesla Model 3", "$37,000", "Sold"},
{"15", "Dodge Charger", "$36,000", "Available"}
};

String[] columns = {"ID", "Model", "Price", "Status"};

carTable = new JTable(data, columns);


JScrollPane scrollPane = new JScrollPane(carTable);

generateBillButton = new JButton("Generate Bill");


generateBillButton.addActionListener(e -> generateBill());

JPanel bottomPanel = new JPanel();


bottomPanel.add(generateBillButton);

Dept. of CSE, SCE 2024-25 6


CAR SHOWROOM SYSTEM

add(scrollPane, BorderLayout.CENTER);
add(bottomPanel, BorderLayout.SOUTH);
}

private void generateBill() {


int selectedRow = carTable.getSelectedRow();
if (selectedRow == -1) {
JOptionPane.showMessageDialog(this, "Please select a car.");
return;
}

String model = (String) carTable.getValueAt(selectedRow, 1);


String price = (String) carTable.getValueAt(selectedRow, 2);
String status = (String) carTable.getValueAt(selectedRow, 3);

if (!status.equalsIgnoreCase("Available")) {
JOptionPane.showMessageDialog(this, "This car is not available for purchase.");
return;
}

String bill = "----- Car Purchase Bill -----\n" +


"Car Model: " + model + "\n" +
"Price: " + price + "\n" +
"Status: " + status + "\n" +
"Thank you for your purchase!";

JOptionPane.showMessageDialog(this, bill, "Bill", JOptionPane.INFORMATION_MESSAGE);


}
}

class AddCarPanel extends JPanel {


private JTextField idField, modelField, priceField, statusField;

Dept. of CSE, SCE 2024-25 7


CAR SHOWROOM SYSTEM

public AddCarPanel() {
setLayout(new GridLayout(6, 2));

add(new JLabel("Car ID:"));


idField = new JTextField();
add(idField);

add(new JLabel("Model:"));
modelField = new JTextField();
add(modelField);

add(new JLabel("Price:"));
priceField = new JTextField();
add(priceField);

add(new JLabel("Status:"));
statusField = new JTextField();
add(statusField);

JButton addButton = new JButton("Add Car");


addButton.addActionListener(e -> addCar());
add(addButton);
}

private void addCar() {

String id = idField.getText();
String model = modelField.getText();
String price = priceField.getText();
String status = statusField.getText();

JOptionPane.showMessageDialog(this, "Car added: " + model);


idField.setText("");}

Dept. of CSE, SCE 2024-25 8


CAR SHOWROOM SYSTEM

SCREENSHOTS

Dept. of CSE, SCE 2024-25 9


CAR SHOWROOM SYSTEM

Dept. of CSE, SCE 2024-25 10


CAR SHOWROOM SYSTEM

REFERENCES

[1] Oracle Java Documentation


https://docs.oracle.com/javase/8/docs/
– Official documentation for Java SE, including Java Swing components and event handlin[2g.

[2] Java Swing Tutorial – GeeksforGeeks


https://www.geeksforgeeks.org/java-swing/
– Provides practical examples and explanations of Java Swing components.

[3] Swing Tutorial – TutorialsPoint


https://www.tutorialspoint.com/swing/index.htm
– A comprehensive guide on building GUI applications with Java Swing.

[4] Stack Overflow


https://stackoverflow.com/
– Used for resolving code-level queries and understanding best practices for Java GUI design.

[5] Java Platform, Standard Edition 8 API Specification


https://docs.oracle.com/javase/8/docs/api/
– API reference for Java classes and packages used in the application

Dept. of CSE, SCE 2024-25 11

You might also like