Sunteți pe pagina 1din 44

A

TRAINING REPORT

ON

PARKING SYSTEM

Submitted in the partial fulfillment for the award of degree of

BACHELOR OF TECHNOLOGY

In

COMPUTER SCIENCE AND ENGINEERING

Submitted by: NAVNEET KAUR (1715160)

Session:- Aug 2017-Dec 2017

Submitted To:

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

HARYANA COLLEGE OF TECHNOLOGY AND MANAGEMENT,KAITHAL-


136027

Affiliated To

KURUKSHETRA UNIVERSITY, KURUKSHETRA, HARYANA

Page 1
CONTENTS

SR. NO. DETAILS PAGE NO.

1. 3
CERTIFICATE

2. CANDIDATES DECLARATION 4

3. ACKNOWLEDGEMENT 5

4. ABSTRACT 6

5. INTRODUCTION 79

6. DATABASE/ TABLES 10-11

7. CODING 12-38

SCREENSHOTS 38-42
8.

9. CONCLUSION & FUTURE SCOPE 43

10. REFERENCES 44

Page 2
CERTIFICATE

Page 3
CANDIDATES DECLARATION

I hereby certify that the present Training project work entitled PARKING SYSTEM
being submitted by me in partial fulfillment for the award of degree of Bachelor of
Technology in Computer Science and Engineering is an authentic record of the work
carried out, for the session 2017-18
I or anybody else has not submitted the matter embodied in this minor project for the
award of any other Degree to this or any other University/Institution.

Signature of the student


Navneet Kaur
Roll no.1715160

Page 4
ACKNOWLEDGEMENT

Many lives and destinies are destroyed due to lack of proper guidance, direction and
opportunity. It is in this respect that we are in a much better position today due to
continuous process of motivation and focus provided by our parents and teachers in
general.

The process of completion of this project was a tedious job and required careful guidance
at all stages. I would like to highlight the role played by many individuals towards this.

I am also highly indebted to Mr. HIMANSHU GARG for the constant motivation,
support and guidance. His experience went a long way in assisting me throughout the
duration of the project.

Navneet Kaur
1715160

Page 5
ABSTRACT

Java has vast future in technologies so, I have completed my training in Core Java
technologies. Core Java is easy to learn language . I have prepared training report on the
basis of all my learning. I have prepared project "PARKING SYSTEM" in Core Java. I
have described my project in this report. All the source coding and all databases are
properly described in this report. Screenshots are added in this report for better
description of this project. Conclusion regarding this application and all the future work
on Java is included in the end of the report. All the references i used in learning Core java
are also described in the end.

Page 6
INTRODUCTION

1.PROJECT INTRODUCTION
In the modern world, where parking-space has become a very big problem and in the era
of miniaturization, it is become a very crucial necessity to avoid the wastage of space in
modern, big companies and apartments etc. In places where more than 100 cars need to
be parked, this system proves to be useful in reducing wastage of space. This Automatic
Multi-Level Car Parking System enables the parking of vehicles, floor after floor and
thus reducing the space used. Here any number of cars can be parked according to the
requirement. This makes the system modernized and even a space-saving one.

Automatic Multi-Level Car Parking System provides an automatic parking mechanism


which works as follow -

When any vehicle enters the parking facility it gets detected using some Infra-red sensors
and gate is opened for vehicle entry and Vehicle Counter is incremented.

One Bi-Color Led which blinks Red if lift is busy or Green if lift is free and on ground
floor ready to serve the next vehicle. Lift is equiped with multiple sensors for automatic
operations and one button for returning condition.

On Green Signal vehicle must moved into the lift. When Lift detects the vechile placed in
proper orientation, it starts moving and stops on the floor where slots for parking is
available. Space Availablity on a particular floor is maintained on sensor basis. After the
parking is done user has to press a button on lift to come back down on ground floor.

Signal for a particular event is indicated timely by some Leds and a beeper. Parking
System also include a LCD to display Important messages to user.

Features

Car Counting System using Infra-Red Sensors.


Automatic Door Opening using IR Sensors.
Sensor based Lift System for moving vehicle to the right floor.
Easy to use System.
Multiple Floor to reduce space.

Page 7
2. INTRODUCTION TO JAVA
Java (with a capital J) is a high-level, third generation programming language, like C, Fortran,
Smalltalk, Perl, and many others. You can use Java to write computer applications that crunch
numbers, process words, play games, store data or do any of the thousands of other things
computer software can do.
Compared to other programming languages, Java is most similar to C. However although Java
shares much of C's syntax, it is not C. Knowing how to program in C or, better yet, C++, will
certainly help you to learn Java more quickly, but you don't need to know C to learn Java.
Unlike C++ Java is not a superset of C. A Java compiler won't compile C code, and most large C
programs need to be changed substantially before they can become Java programs.

Java is a Platform
Java is a platform for application development. Java solves the problem of platform-
independence by using byte code. The Java compiler does not produce native executable
code for a particular machine like a C compiler would. Instead it produces a special
format called byte code.

Java is Simple
Java was designed to make it much easier to write bug free code. According to Sun's Bill
Joy, shipping C code has, on average, one bug per 55 lines of code. The most important
part of helping programmers write bug-free code is keeping the language simple.

Java is Object-Oriented

Object oriented programming is the catch phrase of computer programming in the 1990's.
Although object oriented programming has been around in one form or another since the
Simula language was invented in the 1960's, it's really begun to take hold in modern GUI
environments like Windows, Motif and the Mac. In object-oriented programs data is
represented by objects. Objects have two sections, fields (instance variables) and
methods. Fields tell you what an object is.

Page 8
When an object receives a message it responds accordingly as defined by its methods.

Object oriented programming is alleged to have a number of advantages including:

Simpler, easier to read programs

More efficient reuse of code

Faster time to market

More robust, error-free code

Java is Platform Independent

Java was designed to not only be cross-platform in source form like C, but also in
compiled binary form. Since this is frankly impossible across processor architectures Java
is compiled to an intermediate form called byte-code. A Java program never really
executes natively on the host machine. Rather a special native program called the Java
interpreter reads the byte code and executes the corresponding native machine
instructions.

Java is Safe

Java was designed from the ground up to allow for secure execution of code across a
network, even when the source of that code was untrusted and possibly malicious.

Java is High Performance

Java byte codes can be compiled on the fly to code that rivals C++ in speed using a "just-
in-time compiler." Several companies are also working on native-machine-architecture
compilers for Java. These will produce executable code that does not require a separate
interpreter, and that is indistinguishable in speed from C++.

Package:
Packages in Java is a mechanism to encapsulate a group of classes, interfaces and sub
packages. Many implementations of Java use a hierarchical file system to manage source
and class files. It is easy to organize class files into packages.

Page 9
DATABASE
DATABASE USED:

MICROSOFT ACCESS DATABASE

TABLES CREATED:

Login table

Entry table

Page
10
Block table

Page
11
CODING

Frames

Login Frame
Entry Frame
Exit Frame
Search Frame

Login frame

package loginPanel;

import connection.ConnectionDB;

import java.awt.event.KeyEvent;

import java.sql.ResultSet;

import java.sql.Statement;

import javax.swing.JOptionPane;

public class Login extends javax.swing.JFrame {

public Login() {

initComponents();

setLocationRelativeTo(null);

login.setMnemonic(KeyEvent.VK_J);

@SuppressWarnings("unchecked")

// <editor-fold defaultstate="collapsed" desc="Generated Code">

private void initComponents() {

icon = new javax.swing.JLabel();

Page
12
jLabel1 = new javax.swing.JLabel();

jLabel2 = new javax.swing.JLabel();

user = new javax.swing.JTextField();

login = new javax.swing.JButton();

pass = new javax.swing.JPasswordField();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

icon.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/Images/login.png"))); // NOI18N

jLabel1.setFont(new java.awt.Font("Tahoma", 3, 11)); // NOI18N

jLabel1.setText("Username");

jLabel2.setFont(new java.awt.Font("Tahoma", 3, 11)); // NOI18N

jLabel2.setText("Password");

login.setText("Login");

login.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

loginActionPerformed(evt);

};

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());

getContentPane().setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(160, 160, 160)

Page
13
.addComponent(icon)

.addContainerGap(182, Short.MAX_VALUE))

.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)

.addGroup(layout.createSequentialGroup()

.addContainerGap()

.addComponent(login))

.addGroup(layout.createSequentialGroup()

.addGap(99, 99, 99)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(jLabel1)

.addComponent(jLabel2))

.addGap(72, 72, 72)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(pass, javax.swing.GroupLayout.DEFAULT_SIZE, 171,
Short.MAX_VALUE) .addComponent(user,
javax.swing.GroupLayout.DEFAULT_SIZE, 171,Short.MAX_VALUE))))

.addGap(186, 186, 186))

);

layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addContainerGap()

.addComponent(icon)

Page
14
.addGap(45, 45, 45)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE
)

.addComponent(jLabel1)

.addComponent(user, javax.swing.GroupLayout.PREFERRED_SIZE, 29,


javax.swing.GroupLayout.PREFERRED_SIZE))

.addGap(46, 46, 46)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE
)

.addComponent(jLabel2)

.addComponent(pass, javax.swing.GroupLayout.PREFERRED_SIZE, 29,


javax.swing.GroupLayout.PREFERRED_SIZE))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

.addComponent(login, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addContainerGap())

);

pack();

}// </editor-fold>

private void loginActionPerformed(java.awt.event.ActionEvent evt) {

try {

connection.ConnectionDB get=new ConnectionDB();

Statement stmt=get.connect();

Page
15
ResultSet rs=stmt.executeQuery("select * from login where
username='"+user.getText()+"' && password='"+pass.getText()+"'");

if(rs.next()){

this.setVisible(false);

new entry.Entry().setVisible(true);

else{

JOptionPane.showMessageDialog(null,"Login Failed!!!");

} catch (Exception e) {

e.printStackTrace();

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new Login().setVisible(true);

});

// Variables declaration - do not modify

private javax.swing.JLabel icon;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel2;

Page
16
private javax.swing.JButton login;

private javax.swing.JPasswordField pass;

private javax.swing.JTextField user;

// End of variables declaration

Entry Frame

package entry;

import addUser.NewUser;

import blockID.BlockID;

import connection.ConnectionDB;

import count.CountBlock;

import getDate.GetDDt;

import java.sql.Statement;

import javax.swing.JOptionPane;

import serialNo.SerialNo;

public class Entry extends javax.swing.JFrame {

public Entry() {

initComponents();

setLocationRelativeTo(null);

GetDDt t=new GetDDt();

date.setText(t.getDate());

time.setText(t.getTime());

serialNo.SerialNo s=new SerialNo();

Page
17
serialNo.setText(s.getSerailNo());

@SuppressWarnings("unchecked")

// <editor-fold defaultstate="collapsed" desc="Generated Code">

private void initComponents() {

jLabel1 = new javax.swing.JLabel();

jLabel2 = new javax.swing.JLabel();

jLabel3 = new javax.swing.JLabel();

jLabel4 = new javax.swing.JLabel();

jLabel5 = new javax.swing.JLabel();

jLabel6 = new javax.swing.JLabel();

jLabel7 = new javax.swing.JLabel();

jLabel8 = new javax.swing.JLabel();

serialNo = new javax.swing.JTextField();

carNo = new javax.swing.JTextField();

category = new javax.swing.JComboBox();

blockNo = new javax.swing.JComboBox();

date = new javax.swing.JTextField();

time = new javax.swing.JTextField();

jButton1 = new javax.swing.JButton();

jButton3 = new javax.swing.JButton();

jLabel9 = new javax.swing.JLabel();

jLabel10 = new javax.swing.JLabel();

ah = new javax.swing.JLabel();

bh = new javax.swing.JLabel();

Page
18
ch = new javax.swing.JLabel();

d1 = new javax.swing.JLabel();

ahw = new javax.swing.JTextField();

bhw = new javax.swing.JTextField();

chw = new javax.swing.JTextField();

dhw = new javax.swing.JTextField();

jLabel15 = new javax.swing.JLabel();

jLabel16 = new javax.swing.JLabel();

a1 = new javax.swing.JLabel();

b1 = new javax.swing.JLabel();

jLabel19 = new javax.swing.JLabel();

jLabel20 = new javax.swing.JLabel();

alw = new javax.swing.JTextField();

blw = new javax.swing.JTextField();

clw = new javax.swing.JTextField();

dlw = new javax.swing.JTextField();

jMenuBar1 = new javax.swing.JMenuBar();

jMenu3 = new javax.swing.JMenu();

jMenu1 = new javax.swing.JMenu();

jMenu2 = new javax.swing.JMenu();

logout = new javax.swing.JMenu();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

addWindowListener(new java.awt.event.WindowAdapter() {

public void windowOpened(java.awt.event.WindowEvent evt) {

Page
19
formWindowOpened(evt);

});

jLabel1.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/Images/images.jpg"))); // NOI18N

jLabel2.setFont(new java.awt.Font("Tahoma", 1, 18));

jLabel2.setText("PARKING");

jLabel3.setText("Serial no");

jLabel4.setText("category");

jLabel5.setText("Vehicle no");

jLabel6.setText("Block no");

jLabel7.setText("Date");

jLabel8.setText("Time");

serialNo.setEditable(false);

category.setModel(new javax.swing.DefaultComboBoxModel(new String[] {


"HEAVY WEIGHT VEHICLE", "LIGHT WEIGHT VEHICLE" }));

blockNo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "A",


"B", "C", "D" }));

date.setEditable(false);

time.setEditable(false);

jButton1.setText("Cancle");

jButton1.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

jButton1ActionPerformed(evt);

Page
20
});

jButton3.setText("Submit");

jButton3.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

jButton3ActionPerformed(evt);

});

jLabel9.setFont(new java.awt.Font("Tahoma", 3, 11));

jLabel9.setText("BLOCK");

jLabel10.setFont(new java.awt.Font("Tahoma", 3, 11));

jLabel10.setText("VACANT SLOT");

ah.setText("A");

bh.setText("B");

ch.setText("C");

d1.setText("D");

ahw.setEditable(false);

bhw.setEditable(false);

chw.setEditable(false);

chw.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

chwActionPerformed(evt);

});

Page
21
dhw.setEditable(false);

jLabel15.setText("LWV");

jLabel16.setText("HWV");

a1.setText("A");

b1.setText("B");

jLabel19.setText("C");

jLabel20.setText("D");

alw.setEditable(false);

blw.setEditable(false);

blw.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

blwActionPerformed(evt);

});

clw.setEditable(false);

dlw.setEditable(false);

jMenu3.setText("Add User");

jMenu3.addMouseListener(new java.awt.event.MouseAdapter() {

public void mouseClicked(java.awt.event.MouseEvent evt) {

jMenu3MouseClicked(evt);

});

jMenuBar1.add(jMenu3);

jMenu1.setText("Search Vehicle");

jMenu1.addMouseListener(new java.awt.event.MouseAdapter() {

Page
22
public void mouseClicked(java.awt.event.MouseEvent evt) {

jMenu1MouseClicked(evt);

});

jMenuBar1.add(jMenu1);

jMenu2.setText("Exit");

jMenu2.addMouseListener(new java.awt.event.MouseAdapter() {

public void mouseClicked(java.awt.event.MouseEvent evt) {

jMenu2MouseClicked(evt);

});

jMenuBar1.add(jMenu2);

logout.setText("Logout");

logout.addMouseListener(new java.awt.event.MouseAdapter() {

public void mouseClicked(java.awt.event.MouseEvent evt) {

logoutMouseClicked(evt);

});

jMenuBar1.add(logout);

setJMenuBar(jMenuBar1);

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());

getContentPane().setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

Page
23
.addGroup(layout.createSequentialGroup()

.addContainerGap()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)

.addGroup(layout.createSequentialGroup()

.addComponent(jLabel1)

.addGap(57, 57, 57)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)

.addComponent(jLabel4)

.addComponent(jLabel5)

.addComponent(jLabel3)))

.addComponent(jLabel6)

.addComponent(jLabel7)

.addComponent(jLabel8))

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(49, 49, 49)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(date, javax.swing.GroupLayout.DEFAULT_SIZE,
117, Short.MAX_VALUE)

.addComponent(category, 0, 117, Short.MAX_VALUE)

Page
24
.addComponent(carNo,
javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)

.addComponent(serialNo,
javax.swing.GroupLayout.PREFERRED_SIZE, 117,
javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(time,
javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)

.addComponent(blockNo, 0, 117, Short.MAX_VALUE)))

.addComponent(jLabel2))

.addGap(92, 92, 92)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(jLabel9)

.addComponent(ah)

.addComponent(bh)

.addComponent(ch)

.addComponent(d1))

.addGap(60, 60, 60)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)

.addComponent(jLabel10,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addComponent(ahw)

.addComponent(bhw)

Page
25
.addComponent(chw)

.addComponent(dhw)))

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(jLabel19)

.addComponent(b1)

.addComponent(a1)

.addComponent(jLabel20))

.addGap(94, 94, 94)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(dlw, javax.swing.GroupLayout.DEFAULT_SIZE,
70, Short.MAX_VALUE)

.addComponent(blw, javax.swing.GroupLayout.DEFAULT_SIZE,
70, Short.MAX_VALUE)

.addComponent(alw,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, 70, Short.MAX_VALUE)

.addComponent(clw,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, 70, Short.MAX_VALUE))))

.addGap(51, 51, 51))

.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addComponent(jLabel15)

.addGap(142, 142, 142))))

Page
26
.addGroup(layout.createSequentialGroup()

.addGap(337, 337, 337)

.addComponent(jButton3)

.addGap(18, 18, 18)

.addComponent(jButton1)

.addContainerGap(345, Short.MAX_VALUE))

.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()

.addContainerGap(674, Short.MAX_VALUE)

.addComponent(jLabel16)

.addGap(133, 133, 133))

);

layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(20, 20, 20)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(jLabel2)

.addComponent(jLabel1)))

.addGroup(layout.createSequentialGroup()

.addGap(95, 95, 95)

Page
27
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE
)

.addComponent(jLabel3)

.addComponent(serialNo,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jLabel9)

.addComponent(jLabel10))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addComponent(jLabel15)

.addGap(14, 14, 14)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(jLabel4)

.addComponent(category,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))

.addGap(34, 34, 34)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE
)

.addComponent(jLabel5)

Page
28
.addComponent(carNo,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(bh)

.addComponent(bhw,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE
)

.addComponent(ah)

.addComponent(ahw,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))))

.addGap(24, 24, 24)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(52, 52, 52)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE
)

.addComponent(jLabel7)

.addComponent(date, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(d1)

.addComponent(dhw, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))

Page
29
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE
)

.addComponent(jLabel6)

.addComponent(ch)

.addComponent(chw, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(blockNo, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

.addComponent(jLabel16)

.addGap(21, 21, 21)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE
)

.addComponent(time, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jLabel8)

.addComponent(a1)

.addComponent(alw, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(49, 49, 49)


.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE
)

Page
30
.addComponent(jButton3)

.addComponent(jButton1)))

.addGroup(layout.createSequentialGroup()

.addGap(39, 39, 39)


.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE
)

.addComponent(b1)

.addComponent(blw, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))))

.addGap(11, 11, 11)


.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE
)

.addComponent(jLabel19)

.addComponent(clw, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))

.addGap(31, 31, 31)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE
)

.addComponent(jLabel20)

.addComponent(dlw, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))

.addContainerGap(117, Short.MAX_VALUE))

);

pack();

}// </editor-fold>

private void chwActionPerformed(java.awt.event.ActionEvent evt) {

Page
31
// TODO add your handling code here:

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {

if(checkVacantBlock())

JOptionPane.showMessageDialog(null, "BLOCK FULL!!Choose another block");

else if(cn.checkVehicle(carNo.getText())){

JOptionPane.showMessageDialog(null, "Already Enterd vehicle of


"+carNo.getText()+" no. ");

else if(!carNo.getText().equals("") ){

connection.ConnectionDB get=new ConnectionDB();

Statement stmt=get.connect();

GetDDt d=new GetDDt();

int i=0;

blockID.BlockID gets=new BlockID();

try {

String
values="'"+serialNo.getText()+"','"+category.getSelectedItem()+"','"+carNo.getText()+"','
"+blockNo.getSelectedItem()+"','"+d.getDate()+"','"+d.getTime()+"',"+gets.getBlockID(b
lockNo.getSelectedItem().toString(), category.getSelectedItem().toString())+"";

i=stmt.executeUpdate("insert into
entry(serialNo,category,carNo,blockNo,date,time,blockID) values("+values+")");

if(i>0){

JOptionPane.showMessageDialog(null, "Sucessfully Entered");

CountBlock cb=new CountBlock();

Page
32
carNo.setText("");

ahw.setText("("+cb.getVacantSlot("AL")+")");

bhw.setText("("+cb.getVacantSlot("BL")+")");

chw.setText("("+cb.getVacantSlot("CL")+")");

dhw.setText("("+cb.getVacantSlot("DL")+")");

alw.setText("("+cb.getVacantSlot("AH")+")");

blw.setText("("+cb.getVacantSlot("BH")+")");

clw.setText("("+cb.getVacantSlot("CH")+")");

dlw.setText("("+cb.getVacantSlot("DH")+")");

carNo.setText("");

serialNo.SerialNo s=new SerialNo();

serialNo.setText(s.getSerailNo());

}else{

JOptionPane.showMessageDialog(null, "Failed While Updating");

} catch (Exception e) {

e.printStackTrace();

else{

JOptionPane.showMessageDialog(null, "Vehicle No. required");

public boolean checkVacantBlock(){

if((alw.getText().equals("(0)") && blockNo.getSelectedItem().equals("A") &&

Page
33
category.getSelectedItem().equals("HEAVY WEIGHT VEHICLE")) ||

( blw.getText().equals("(0)") && blockNo.getSelectedItem().equals("B") &&


category.getSelectedItem().equals("HEAVY WEIGHT VEHICLE"))

||( clw.getText().equals("(0)") && blockNo.getSelectedItem().equals("C") &&


category.getSelectedItem().equals("HEAVY WEIGHT VEHICLE"))||

(dlw.getText().equals("(0)") && blockNo.getSelectedItem().equals("D") &&


category.getSelectedItem().equals("HEAVY WEIGHT VEHICLE"))

|| (ahw.getText().equals("(0)") && blockNo.getSelectedItem().equals("A") &&


category.getSelectedItem().equals("LIGHT WEIGHT VEHICLE") )||

(bhw.getText().equals("(0)") && blockNo.getSelectedItem().equals("B") &&


category.getSelectedItem().equals("LIGHT WEIGHT VEHICLE")

)|| (chw.getText().equals("(0)") && blockNo.getSelectedItem().equals("C")


&& category.getSelectedItem().equals("LIGHT WEIGHT VEHICLE")

)|| (dhw.getText().equals("(0)") && blockNo.getSelectedItem().equals("D")


&& category.getSelectedItem().equals("LIGHT WEIGHT VEHICLE")))

return true;

else{

return false;

private void blwActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

private void formWindowOpened(java.awt.event.WindowEvent evt) {

CountBlock cb=new CountBlock();

carNo.setText("");

Page
34
ahw.setText("("+cb.getVacantSlot("AL")+")");

bhw.setText("("+cb.getVacantSlot("BL")+")");

chw.setText("("+cb.getVacantSlot("CL")+")");

dhw.setText("("+cb.getVacantSlot("DL")+")");

alw.setText("("+cb.getVacantSlot("AH")+")");

blw.setText("("+cb.getVacantSlot("BH")+")");

clw.setText("("+cb.getVacantSlot("CH")+")");

dlw.setText("("+cb.getVacantSlot("DH")+")");

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

carNo.setText("");

private void logoutMouseClicked(java.awt.event.MouseEvent evt) {

this.setVisible(false);

new loginPanel.Login().setVisible(true);

private void jMenu1MouseClicked(java.awt.event.MouseEvent evt) {

this.setVisible(false);

new search.SearchVehicle().setVisible(true);

private void jMenu2MouseClicked(java.awt.event.MouseEvent evt) {

this.setVisible(false);

new exit.Exit().setVisible(true);

private void jMenu3MouseClicked(java.awt.event.MouseEvent evt) {

Page
35
this.setVisible(false);

new NewUser().setVisible(true);

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new Entry().setVisible(true);

});

CheckNo cn=new CheckNo();

// Variables declaration - do not modify

private javax.swing.JLabel a1;

private javax.swing.JLabel ah;

private javax.swing.JTextField ahw;

private javax.swing.JTextField alw;

private javax.swing.JLabel b1;

private javax.swing.JLabel bh;

private javax.swing.JTextField bhw;

private javax.swing.JComboBox blockNo;

private javax.swing.JTextField blw;

private javax.swing.JTextField carNo;

private javax.swing.JComboBox category;

private javax.swing.JLabel ch;

private javax.swing.JTextField chw;

Page
36
private javax.swing.JTextField clw;

private javax.swing.JLabel d1;

private javax.swing.JTextField date;

private javax.swing.JTextField dhw;

private javax.swing.JTextField dlw;

private javax.swing.JButton jButton1;

private javax.swing.JButton jButton3;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel10;

private javax.swing.JLabel jLabel15;

private javax.swing.JLabel jLabel16;

private javax.swing.JLabel jLabel19;

private javax.swing.JLabel jLabel2;

private javax.swing.JLabel jLabel20;

private javax.swing.JLabel jLabel3;

private javax.swing.JLabel jLabel4;

private javax.swing.JLabel jLabel5;

private javax.swing.JLabel jLabel6;

private javax.swing.JLabel jLabel7;

private javax.swing.JLabel jLabel8;

private javax.swing.JLabel jLabel9;

private javax.swing.JMenu jMenu1;

private javax.swing.JMenu jMenu2;

private javax.swing.JMenu jMenu3;

private javax.swing.JMenuBar jMenuBar1;

Page
37
private javax.swing.JMenu logout;

private javax.swing.JTextField serialNo;

private javax.swing.JTextField time;

// End of variables declaration

SCREENSHOTS

Page
38
Page
39
Page
40
Page
41
Page
42
FUTURE SCOPE

The reliable intelligent driver assistance systems and safety warning systems is still a
long way to go. However, as computing power, sensing capacity, and wireless
connectivity for vehicles rapidly increase, the concept of assisted driving and proactive
safety warning is speeding towards reality. As technology improves, a vehicle will
become just a computer with tires. Driving on roads will be just like surfing the Web:
there will be traffic congestion but no injuries or fatalities. Advanced driver assistant
systems and new sensing technologies can be highly beneficial, along with large body of
work on automated vehicles. These findings suggest that the research into autonomous
vehicles within the ITS field is a short term reality and a promising research area and
these results constitute the starting point for future developments. Some of the
suggestions towards extension and/or future related works are identified and are
summarized below:

1. New sensory systems and sensory fusion is to be explored to plug additional


information to the control system.

2. This work can be extended to include different maneuvers to make the driving system
capable of dealing with all driving environments.

3. Future issues may also include an algorithm for autonomous formation of the
cooperative driving. Thus, with the current and growing awareness of the importance of
security, trustworthy vehicle autonomous systems can be deployed in few years.

Page
43
REFERENCES
Following books are used as reference:

1)Java The Complete Reference, 8th Edition.

2)PROGRAMMING WITH JAVA By E.Balagurusamy

Following websites are also used as reference:

1)www.javatpoint.com

2)www.javaworld.com

3)www.tutorialspoint.com

4)www.oracle.com/java/

Page
44

S-ar putea să vă placă și