You are on page 1of 16

Movie ticket booking System

Submitted in partial fulfillment of the requirements of the term work of

SE COMPUTER ENGINEERING

by

Krithik Patil(21102193)

Ayush Panigrahi(21102050)

Savinay Pandey(21102125)

Guide

Prof. Merlin Priya Jacob

Department of Computer Engineering


A. P. SHAH INSTITUTE OF TECHNOLOGY, THANE

(2022-2023)
A.P. SHAH INSTITUTE OF TECHNOLOGY

CERTIFICATE
This is to certify that the project entitled “movie ticket booking” is a bonafide work
of Krithik Patil (21102193),Ayush Panigrahi(21102050) and Savinay
Pandey(21102125) submitted to the University of Mumbai in fulfilment of the
requirement for the SBL Mini Project of Bachelor of Engineering in Computer
Engineering

______________
(Name and Sign)
Guide

_____________ _______________
(Name and Sign) (Name and Sign)
Head of Department Principal
Abstract
This is a GUI based project which enables the user to register his/her account and
also allows the user to login and book the tickets for a movie. It is a user friendly
platform where the user can choose the seat based on its availability. Once the seats
are booked our application will show the booked seats in red colour. If the user wants
to cancel his/her booking, we have an option for refund, where the user can cancel
his/her booking. One can see his/her number of seats booked by clicking on the
option “my order”. Many movie ticket booking system do not offer a option for any
refund and are really slow at working. This project aims to make the user experience
better. This project has been designed as a substitution for the big applications which
take up a lot of space and become slow after some time. Many movie ticket booking
system do not offer a option for any refund and are really slow at working. This
project aims to make the user experience better. This project has been designed as a
substitution for the big applications which take up a lot of space and become slow
after some time. It is a user friendly platform where the user can choose the seat
based on its availability. Once the seats are booked our application will show the
booked seats in red colour. If the user wants to cancel his/her booking, we have an
option for refund, where the user can cancel his/her booking. One can see his/her
number of seats booked by clicking on the option “my order”.
CONTENTS
Sr.no Contents Page no.
1. Introduction 5
2. Proposed Systems 6
3. Specifications 7
3.1 Hardware Specifications
3.2 Software Specifications
4. System Implementation 8
Introduction

The main purpose of our online ticket booking system is to


provide an alternate and convenient way for a customer to
buy movie tickets. It is an automatic system. After the data
has been fed into the database, the staff does not need to do
anything with the order once it is received through the
system. This project avoids the heft of any payment before
the movie. You just have to book the seats and then after
watching the movie you will be needed to pay. This project
uses ‘swing’ classes for designing the application and ‘awt’
classes for the event listener which enables the new panel to
open after clicking a button. Also it uses SQL classes for
establishing connection between database and the java
program. The ‘hashmap’ class is used to create the seat panel
through which you can select the seat of your choice. It also
uses the ‘list’ class to serialize the data imported from the
database. The JScrollPane class is used to create the scroll
bar for the applicaton.
PROPOSED SYSTEM
Our project aims in making the availability of movie tickets online and booking for
user easy. For this purpose we have used the programming language Java, in which
swing is used for better look of the application. We have chosen VS Code as an IDE
for executing the program with JDK version 16. The project has been designed to
store the details of the customer after registration so that next time when the user
tries to book any seats it becomes easy for him to login and do the needful as he/she
is saved from wasting a lot of time on filling the details again.
Specifications
HARDWARE SPECIFICATION:
RAM: Minimum of 4GB of ram.
Storage: 4GB of free hard disk space.

SOFTWARE SPECIFICATION:
JDK: The JDK is a development environment for building applications, applets, and
components using the Java programming language. The JDK includes tools useful for
developing and testing programs written in the Java programming language and running on
the Java platform.
SQL: MySql has been used as a database to store the information about the customer
JDBC: JDBC is the driver making the connection between the application and the database
VS Code: IDE to execute the machine vision program. Plenty of extensions, open-source,
and offers cross-platform support.
Git & GitHub: Version Control System used for collaboration.
System Implementation
• The login page:
The login page consists of two labels and text fields i.e. the ‘account’ and the ‘password’ fields.
The labels are created using the JLabel() method and the text fields used to take input are
created using the JTextField() method. When the user inputs the password it is displayed in a
‘*’ format due to the setEchoChar() method. The login page also consists of two buttons,
‘login’ and ‘register’. The buttons are created by JButton() method and all are displayed using
the add() method.
To create the labels:
label3 = new JLabel("Password");
label3.setBounds(125, 165, 64, 20);
To create the text fields and formatting password as ‘*’:
password = new TextField(20);
password.setBounds(239, 165, 166, 20);
password.setEchoChar('*');
• The registration page:
The registration page again contains text fields and labels for ‘name’, ‘account’, ‘password’,
‘confirm password’, ‘email id’, ‘telephone number’ which are also created by the JLabel() and
the JTextField() methods. It consists of a check box saying ‘I have read and accepted the
instructions’. Without clicking it you cannot register yourselves as a customer. Finally it
consists of a register button to store the details of the customer and register him/her. The check
box has been created using the JCheckBox() class.
To create the check box:
JCheckBox checkBox = new JCheckBox("I have read and accpeted the instructions");
checkBox.setBounds(100, 438, 366, 20);
frame.add(checkBox);
• The Order panel:
The movie panel consists of options for choosing between the 6 movies, it also has a button to
display the seats booked along with the time of the show, the seat numbers and the room
number I which the movie will be played by the customer i.e. the ‘my order’ button. It also
displays the thumbnail of the respective movie. It also shows the time of the particular show in
the specific room number along with the price of the ticket. The scroll bar on top of the screen
for switching between movies is made using the JScrollPane and the JPanel classes. The
thumbnail of the movie is displayed using the ImageIcon class inside the swing package and the
movie name is again displayed using the JLabel class. The title panel along with its contents are
created using the JPanel and the JLabel classes.There is a button called ‘choose seat’ which
allows the user to choose a seat of his choice. All the buttons on the screen are made orange
using the setBackground() method available inside the JComponent class.
For making the scroll bar at the top of the panel:
JScrollPane scrollPane = new JScrollPane(jp);



tp.addTab("Movie " + (i + 1), scrollPane);
For inserting the image in the panel:
ImageIcon image = new ImageIcon(movie.getPicUrl());
image.setImage(image.getImage().getScaledInstance(200, 240,
Image.SCALE_DEFAULT));
gbc.gridx = 0;
gbc.gridy = 3;
gbc.gridwidth = 1;
gbc.gridheight = 1;
JLabel jLabel = new JLabel(image);
gb.setConstraints(jLabel, gbc);
jp.add(jLabel);
• The seat panel:
In the order panel if you click on the ‘choose seat’ button a ‘seat panel’ is opened which allows
the user to choose a seat of his/her own choice depending upon the availability. If the seat is
already booked the user can’t choose it and the seat would be filled with red colour which
indicates that the seat isn’t available. The seat panel consists of the seat map and the confirm
button. The seat map is made using the ‘Map’ class inside the java.util package. The
‘JToggleButton’ class is used to choose the seat and converting it into red if it is not available.
If you don’t choose any seat then it will sow a dialog box saying that you need to choose a seat.
After clicking the confirm button the details of the movie and the seats booked is stored.
To create the seat panel:
orderMap = new HashMap<>();
seatMap = new HashMap<>();
JPanel jPanel = new JPanel();
jPanel.setLayout(new BorderLayout());
jPanel.add("Center", addSeat(seatIdList));
jPanel.add("South", addConfirmButton());



JPanel jPanel = new JPanel();

jPanel.setLayout(new GridLayout(8, 10));


int[] bucket = new int[80];
for (int i = 0; i < 80; i++) {
bucket[i] = 0;
}
for (int j = 0; j < seatIdList.size(); j++) {
bucket[seatIdList.get(j)] = 1;
To make unavailable seats red in colour:
for (int i = 0; i < 80; i++) {
JToggleButton b = new JToggleButton(i + 1 + "");
Border border = BorderFactory.createLineBorder(Color.BLACK);
b.setBorder(border);
if (bucket[i] == 1) {
b.setBackground(Color.red);
b.setEnabled(false);
}

• The ‘my order’ panel:


The ‘my order’ panel shows the details of the movie tickets booked i.e. the time of the show the
seat number, the room number in which the movie will be played and an option for refund. The
seat number is showed in the form of row number and column number. The date and time is
imported from the database and then serialized into a list which is then displayed with the help
of the JLabel class. On clicking the refund option a dialog box appears saying ‘Are you sure to
refund the ticket’ along with a ‘yes’ and ‘no’ option.
To display the refund option:
JButton button = new JButton("Refund");
button.setBackground(Color.WHITE);
To display the dialog box after clicking the refund option:
button.addActionListener((ActionEvent e) -> {
int flag = JOptionPane.showConfirmDialog(null, "Are you sure to refund the
ticket?", "Refund", JOptionPane.YES_NO_OPTION);
if (flag == 0) {
//delete order
orderDao.deleteOrderById(order.getId());
//delete seat
seatDao.deleteSeat(order.getSeatId(), order.getRoomId(),
order.getTimetableId());
frame.dispose();
new MyOrderPanel(account).setVisible(true);

} else {
System.out.println("no");
}

You might also like