KEMBAR78
Online Food Ordering System Mbs (2) - Removed | PDF | Databases | Table (Database)
0% found this document useful (0 votes)
23 views70 pages

Online Food Ordering System Mbs (2) - Removed

The document is a project report for an Online Food Ordering System developed by students at SRM Institute of Science and Technology. It outlines the project's objectives, existing systems, design methodology, and implementation details, highlighting the automation of electricity billing to improve efficiency and user convenience. The system is built using Java and SQL, featuring user and admin logins, and aims to streamline the billing process while reducing manual labor.

Uploaded by

srikamali59
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)
23 views70 pages

Online Food Ordering System Mbs (2) - Removed

The document is a project report for an Online Food Ordering System developed by students at SRM Institute of Science and Technology. It outlines the project's objectives, existing systems, design methodology, and implementation details, highlighting the automation of electricity billing to improve efficiency and user convenience. The system is built using Java and SQL, featuring user and admin logins, and aims to streamline the billing process while reducing manual labor.

Uploaded by

srikamali59
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/ 70

ONLINE FOOD ORDERING SYSTEM

21CSC203P/ADVANCED PROGRAMMING
PRACTICE PROJECT REPORT

Submitted by

METHUN RAJ A RA2311003050180

BRIJESH SUDHARSAN V RA2311003050190

SRINITHESH R RA2311003050313
Under the guidance of

Dr. JAYA.
(Assistant Professor, School of Computing)

in partial fulfilment for the award of the degree

of

BACHELOR OF TECHNOLOGY
in

COMPUTER SCIENCE AND ENGINEERING

Of

FACULTY OF ENGINEERING AND TECHNOLOGY

SRM INSTITUTE OF SCIENCE AND


TECHNOLOGY TIRUCHIRAPPALLI
1
SRM INSTITUTE OF SCIENCE AND
TECHNOLOGY
(Deemed to be University U/S 3 of UGC Act, 1956)

BONAFIDECERTIFICATE

Certified that this project report titled ONLINE FOOD


ORDERING SYSTEM is the bonafide work of METHUN RAJ A
RA2311003050180, BRIJESH SUDHARSAN V
RA2311003050190, SRINITHESH R RA2311003050313 who
carried out the project work under my supervision. Certified further,
that to the best of my knowledge the work reported herein does not
form any other project report or dissertation on the basis of which a
degree or award was conferred on an occasion on this or any other
candidate.

SIGNATURE SIGNATURE

Dr. . M.E,Ph.D., Dr. . M.E.,Ph.D.,


Assistant Professor
Head of the Department
School of Computing,
Department of ,
SRM Institute of Science and Technology,
SRM Institute of Science and Technology,
Tiruchirappalli.
Tiruchirappalli.

Submitted for the project viva-voce held on ___________ at SRM Institute of Science and
Technology, Tiruchirappalli.

2
SRM INSTITUTE OF SCIENCE AND
TECHNOLOGY

TIRUCHIRAPPALLI

DECLARATION

We hereby declare that the entire work contained in this project report titled
ONLINE FOOD ORDERING SYSTEM has been carried out by METHUN RAJ A

RA2311003050180, BRIJESH SUDHARSAN V RA2311003050190,


SRINITHESH R RA2311003050313 RA2311003050237 at SRM Institute of
Science and Technology, Tiruchirappalli, under the guidance of Dr. . ,
Assistant Professor, School of Computing.

Place: Tiruchirappalli
Date: 12/11/2024
METHUN RAJ A RA2311003050180
BRIJESH SUDHARSAN V RA2311003050190
SRINITHESH R RA2311003050313

3
ABSTRACT

Electricity consumers are often faced with the problem of inaccuracy and
delay in monthly billing due to some drawbacks. Thus, it is essential to have
an efficient system for such purposes via electronic platform with
consideration to proximity. The proposed system automates the conventional
process of paying electricity bill by visiting the Electricity Board which is
tiresome and time consuming. It is also designed to automate the electricity
bill calculation and payment for user convenience. The system is developed
with Java swings as the base programming language which can be used to
develop websites, web applications and web services. The Microsoft
Structured Query Language (SQL) server is also used for creating back-end
database. The system would be having two logins: the administrative and
user login. The administrator can view the user's account details and can add
the customer's information of consuming units of energy of the current
month in their account. The Admin must feed the system with the electricity
usage data into respective user’s account. The system then calculates the
electricity bill for every user and updates the information into their account
every month. Users can then view their electricity bill and pay before the
month end.

4
TABLE OF CONTENTS
Page .no
ABSTRACT........................................................................................................4

LIST OF FIGURES.............................................................................................8

LIST OF ACRONYMS AND ABBREVIATIONS............................................9

1. Introduction.....................................................................................................10
1.1Introduction................................................................................................10
1.2 Problem.Statement....................................................................................12
1.3 Objectives.................................................................................................13

2. Existing System.............................................................................................15

2.1 Software & Hardware Requirements…………………………………..

3. Design (ER Diagram and Proposed Methodology) .......................................19


3.1 ER. Diagram.............................................................................................19
3.2 Schema Diagram............................................................................20

4. Implementation (Java)...................................................................................27
4.1 Electricity billing system……...............................................................27
4.2 LoadingDiaglog…………………...........................................................37
4.3 LoginPage………………........................................................................38

5. Result and Discussion....................................................................................44

6. Conclusion......................................................................................................47

7. References.......................................................................................................49

5
LIST OF FIGURES

3.1 Block Diagram 18


3.2 ER Diagram for Java Code 23
5.1 Output of sign in page 43
5.2 Output for login page 44
5.3 Output for Ordering page 45

6
LIST OF ACRONYMS AND ABBREVIATIONS
• Eg - Example
• OS – Operating System
• GUI - Graphical User Interface
• UAC – User Account Control
• JAR – Java Archive
• IDE – Integrated Development Environment
• JDK - Java Development Kit

7
CHAPTER 1
INTRODUCTION
1.1 INTRODUCTION

Electricity Billing System is a software-based application.


i. This project aims at serving the department of electricity by
computerizing the billing system.

ii. It mainly focuses on the calculation of units consumed during the


specified time and the money to be charged by the electricity offices
.
iii. This computerized system will make the overall billing system easy,
accessible, comfortable, and effective for consumers.
To design the billing system more service oriented and simple, the
following features have been implemented in the project. The application has
high speed of performance with accuracy and efficiency.
The software provides facility of data sharing, it does not require any staff
as in the conventional system. Once it is installed on the system only the meter
readings are to be given by the admin where customer can view all details, it
has the provision of security restriction.
The electricity billing software calculates the units consumed by the
customer and makes bills, it requires small storage for installation and
functioning. There is provision for debugging if any problem is encountered
in the system.
The system excludes the need of maintaining paper electricity bill,
administrator does not have to keep a manual track of the users, users can pay
the amount without visiting the office. Thus, it saves human efforts and
resources.

8
1.2 PROBLEM STATEMENT:

The manual system is suffering from a series of drawbacks. Since whole of

the bills is to be maintained with hands the process of keeping and

maintaining the information is very tedious and lengthy to customer. It is

very time consuming and laborious process because, staff need to be visited

the customers place every month to give the bills and to receive the payments.

For this reason, we have provided features Present system is partially

automated(computerized), existing system is quite laborious as one must

enter same information at different places.

9
1.3 OBJECTIVES:

• This project system excludes the need of maintaining paper electricity bill
as all the electricity bill records are managed electronically.

• Administrator doesn't have to keep a manual track of the users. The system
automatically calculates fine.

• Users don't have to visit to the office for bill payment.

• There is no need of delivery boy for delivery bills to user's place. Thus, it

saves human efforts and resources.

CHAPTER 2
EXISTING SYSTEM
CHAPTER 2: EXISTING SYSTEM

The conventional system of electricity billing is not so effective; one staff


must visit each customer’s house to note the meter readings and collect the
data. Then, another staff must compute the consumed units and calculate the
money to be paid. Again, the bills prepared are to be delivered to customers.
Finally, individual customer must go to electricity office to pay their dues.

Hence, the conventional electricity billing system is uneconomical, requires


many staffs to do simple jobs and is a lengthy process overall. In order to solve
10
this lengthy process of billing, a web based computerized system is essential.
This proposed electricity billing system project overcomes all these
drawbacks with the features. It is beneficial to both consumers.
With the new system, there is reduction in the number of staffs to be employed
by the company. The working speed and performance of the software is faster
with high performance which saves time. Furthermore, there is very little
chance of miscalculation and being corrupted by the staffs.

1. 2.1 Hardware and Software Requirements:

Hardware Requirements:

➢ Hardware Specification: -Processor Intel Pentium V or higher

➢ Clock Speed: -1.7 GHz or more

➢ System Bus: -64 bits

➢ RAM: -16GB ➢ HDD: -2TB

➢ Monitor: -LCD Monitor

➢ Keyboard: -Standard keyboard

➢ Mouse: -Compatible mouse

Software Requirements:

11
➢ Operating System: -Windows 10

➢ Software: -Microsoft SQL Server

➢ Front End: -Java core/swings (NetBeans)

➢ Back End: -My SQL

• .

2. Graphical User Interface (GUI):

• The system uses Java Swing to create a user-friendly interface. This

GUI allows users to log in, view buses, select seats, and confirm

reservations through clear visual elements like buttons and grids.

• The login interface uses secure password input via JPasswordField

to ensure the confidentiality of credentials.

• The bus viewing and seat selection screens provide a streamlined

experience, with real-time visual updates on seat availability.

• The reservation confirmation screen ensures that the user’s selection

is saved to the database, updating the seat status accordingly.

3. Security Features:

12
• The system employs password hashing with SHA-256 to ensure that

user credentials are never stored in plain text, safeguarding user data

from potential breaches.

• SQL injection prevention is handled by input validation and error

handling mechanisms, minimizing the risk of malicious attacks.

• Only authenticated users are allowed to access certain system

functionalities, such as viewing and making reservations.

• User sessions are managed to maintain data integrity and ensure that

each user’s information is kept secure throughout the interaction.

4. Performance and Resource Efficiency:

• The system is designed to run efficiently on both high- and low-end

machines, making it accessible to users with a wide range of

hardware configurations.

• It minimizes resource usage through lightweight Java Swing

components and optimized database interactions.

• Although designed for single-user operation, the architecture

supports scalability for multi-user environments, allowing it to adapt

as traffic increases, making it suitable for use by bus operators with

larger customer bases.

13
CHAPTER 3
DESIGN (ER DESIGN) AND PROPOSED METHODOLOGY
3.1 BLOCK DIAGRAM

15
Key Components:
1. User Interface (Java Swing):
• Provides windows or dialogs for users to interact with.
• Buttons, labels, text fields, combo boxes for users to select their
order, enter details, and submit.

2. Controller:
• Acts as a mediator between the UI and database.
• Handles user actions (button clicks, form submissions) and
processes them accordingly.
.
3. Database Queries:
• CRUD (Create, Read, Update, Delete) operations to interact with
the database for fetching menu items, saving orders, and updating
stock levels.

PROPOSED METHODOLOGY

1. Start:
• The application begins by initializing the necessary resources and
configurations.

Initialize System:

Set up the graphical user interface (GUI) components such as login, menu
items, and buttons.
• Establish a connection to the MySQL database.
• Load the menu items and order history (if needed) from the
database.

17
3.3 ENTITY RELATIONSHIP DIAGRAM IN JAVA

PROPOSED METHODOLOGY

Database schema is described as database connections and constraints. It contains attributes.


Every database has a state instances represent current set of databases with values. There are
different types of keys in a database schema.

A primary key is a table column that can be used to uniquely identify every row of the table.
Any column that has this property, these columns are called candidate key. A composite
primary key is a primary key consisting of more than one column. A foreign is a column or
combination of columns that contains values that are found in the primary key of some table.

All the attributes of each table are interconnected by foreign key which is primary key in
another column and composite key. Primary key cannot be null. The fact that many foreign
key values repeat simply reflects the fact that its one-to-many relationship. In one-to-many
relationship, the primary key has the one value and foreign key has many values.

Figure 3.1.2 is a Schema diagram of Electricity Billing System which has six tables i.e.,
login, customer, tax, rent, bill, and meter_info where each table contain attributes some with
primary key, foreign key. In the login table there are 6 attributes "meter_no”, "username”,
“password”, "user”, "question”, "answer”. The customer table has 7 attributes "name”,
"meter_no"(primary key), "address”, "city”, "state”, “email”, "phone”. The rent table has 3
attributes "cost_per_unit"(primary key), " meter_rent”, "service_charge". The tax table has 3
attributes " service_tax”, "swacch_bharat_cess”, "gst”. The bill table has 5 attributes
"meter_no"(foreign key that references the primary key of the customer table meter_no),
"month”, "units”,"total_bill”, "status”. The meter_info table has 6 attributes
"meter_no"(foreign key that references the primary key of the customer table meter_no),
"meter_location”, "meter_type”, "phase_code”, " bill_type”, "days "

21
CHAPTER 4

IMPLEMENTATION (JAVA)

4. IMPLEMENTATION IN JAVA

and availability.hg package electricity.billing.system;

import javax.swing.*;

import java.awt.*;

import java.awt.event.*;

import java.sql.ResultSet;

public class Signup extends JFrame implements ActionListener {

Choice loginASCho;

TextField meterText,EmployerText,userNameText,nameText,passwordText;

JButton create,back;

Signup(){

super("Signup Page");

getContentPane().setBackground(new Color(168,203,255));

23
JLabel createAs = new JLabel("Create Account As");

createAs.setBounds(30,50,125,20);

add(createAs);

loginASCho = new Choice();

loginASCho.add("Admin");

loginASCho.add("Customer");

loginASCho.setBounds(170,50,120,20);

add(loginASCho);

JLabel meterNo = new JLabel("Meter Number");

meterNo.setBounds(30,100,125,20);

meterNo.setVisible(false);

add(meterNo);

meterText = new TextField();

24
meterText.setBounds(170,100,125,20);

meterText.setVisible(false);

add(meterText);

JLabel Employer = new JLabel("Employer ID");

Employer.setBounds(30,100,125,20);

Employer.setVisible(true);

add(Employer);

EmployerText = new TextField();

EmployerText.setBounds(170,100,125,20);

EmployerText.setVisible(true);

add(EmployerText);

JLabel userName = new JLabel("UserName");

userName.setBounds(30,140,125,20);

add(userName);

25
userNameText = new TextField();

userNameText.setBounds(170,140,125,20);

add(userNameText);

JLabel name = new JLabel("Name");

name.setBounds(30,180,125,20);

add(name);

nameText = new TextField("");

nameText.setBounds(170,180,125,20);

add(nameText);

meterText.addFocusListener(new FocusListener() {

@Override

public void focusGained(FocusEvent e) {

26
}

@Override

public void focusLost(FocusEvent e) {

try{

database c = new database();

ResultSet resultSet = c.statement.executeQuery("select * from

Signup where meter_no = '"+meterText.getText()+"'");

if (resultSet.next()){

nameText.setText(resultSet.getString("name"));

}catch (Exception E){

E.printStackTrace();

});

27
JLabel password = new JLabel("Password");

password.setBounds(30,220,125,20);

add(password);

passwordText = new TextField();

passwordText.setBounds(170,220,125,20);

add(passwordText);

loginASCho.addItemListener(new ItemListener() {

@Override

public void itemStateChanged(ItemEvent e) {

String user = loginASCho.getSelectedItem();

if (user.equals("Customer")){

Employer.setVisible(false);

nameText.setEditable(false);

28
EmployerText.setVisible(false);

meterNo.setVisible(true);

meterText.setVisible(true);

}else {

Employer.setVisible(true);

EmployerText.setVisible(true);

meterNo.setVisible(false);

meterText.setVisible(false);

});

create = new JButton("Create");

create.setBackground(new Color(66,127,219));

create.setForeground(Color.black);

create.setBounds(50,285,100,25);

29
create.addActionListener(this);

add(create);

back = new JButton("Back");

back.setBackground(new Color(66,127,219));

back.setForeground(Color.black);

back.setBounds(180,285,100,25);

back.addActionListener(this);

add(back);

ImageIcon boyIcon = new

ImageIcon(ClassLoader.getSystemResource("icon/boy.png"));

Image boyImg =

boyIcon.getImage().getScaledInstance(250,250,Image.SCALE_DEFAULT);

ImageIcon boyIcon2 = new ImageIcon(boyImg);

JLabel boyLabel = new JLabel(boyIcon2);

boyLabel.setBounds(320,30,250,250);

add(boyLabel);

30
setSize(600,380);

setLocation(500,200);

setLayout(null);

setVisible(true);

@Override

public void actionPerformed(ActionEvent e) {

if (e.getSource()== create){

String sloginAs = loginASCho.getSelectedItem();

String susername = userNameText.getText();

String sname = nameText.getText();

String spassword = passwordText.getText();

String smeter = meterText.getText();

try{

database c = new database();

31
String query= null;

if (loginASCho.equals("Admin")) {

query = "insert into Signup value('" + smeter + "', '" + susername +

"', '" + sname + "','" + spassword + "','" + sloginAs + "')";

}else {

query = "update Signup set username = '"+susername+"', password

= '"+spassword+"', usertype = '"+sloginAs+"' where meter_no = '"+smeter+"'";

c.statement.executeUpdate(query);

JOptionPane.showMessageDialog(null,"Account Created");

setVisible(false);

new Login();

}catch (Exception E){

E.printStackTrace();

} else if (e.getSource()==back) {

32
setVisible(false);

new Login();

public static void main(String[] args) {

new Signup();

ackage electricity.billing.system;

import java.sql.*;

public class database {

Connection connection;

Statement statement;

database(){

try {

33
connection =

DriverManager.getConnection("jdbc:mysql://localhost:3306/Bill_system","root

","AyushVish");

statement = connection.createStatement();

}catch (Exception e){

e.printStackTrace();

package electricity.billing.system;

import net.proteanit.sql.DbUtils;

import javax.swing.*;

import java.awt.*;

imort java.sql.ResultSet;

public class bill_details extends JFrame {

String meter;

bill_details(String meter){

this.meter =meter;

34
setSize(700,650);

setLocation(400,150);

setLayout(null);

getContentPane().setBackground(Color.WHITE);

JTable table = new JTable();

try{

database c = new database();

String query_bill = "select * from bill where meter_no = '"+meter+"'";

ResultSet resultSet = c.statement.executeQuery(query_bill);

table.setModel(DbUtils.resultSetToTableModel(resultSet));

}catch (Exception e){

e.printStackTrace();

JScrollPane sp = new JScrollPane(table);

sp.setBounds(0,0,700,650);

add(sp);

35
setVisible(true);

public static void main(String[] args) {

new bill_details("");

package electricity.billing.system;

import javax.swing.*;

import java.awt.*;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.sql.ResultSet;

public class generate_bill extends JFrame implements ActionListener {

Choice searchmonthcho;

String meter;

JTextArea area;

JButton bill;

36
generate_bill(String meter){

this.meter=meter;

setSize(500,700);

setLocation(500,30);

setLayout( new BorderLayout());

JPanel panel = new JPanel();

JLabel heading = new JLabel("Generate Bill");

JLabel meter_no = new JLabel(meter);

searchmonthcho = new Choice();

searchmonthcho.add("January");

searchmonthcho.add("February");

searchmonthcho.add("March");

searchmonthcho.add("April");

searchmonthcho.add("May");

37
searchmonthcho.add("June");

searchmonthcho.add("July");

searchmonthcho.add("August");

searchmonthcho.add("September");

searchmonthcho.add("October");

searchmonthcho.add("November");

searchmonthcho.add("December");

area= new JTextArea(50,15);

area.setText("\n \n \t ------------------- Click on the ---------------\n \t ---------

---------- Generate Bill");

area.setFont(new Font("Senserif",Font.ITALIC,15));

JScrollPane pane = new JScrollPane(area);

bill = new JButton("Generate Bill");

bill.addActionListener(this);

add(pane);

panel.add(heading);

panel.add(meter_no);

38
panel.add(searchmonthcho);

add(panel,"North");

add(bill,"South");

setVisible(true);

@Override

public void actionPerformed(ActionEvent e) {

try{

database c = new database();

String smonth = searchmonthcho.getSelectedItem();

area.setText("\n Power Limited \n Electricity Bill For Month of

"+smonth+",2023\n\n\n");

ResultSet resultSet = c.statement.executeQuery("select * from

new_customer where meter_no ='"+meter+"'");

if (resultSet.next()){

area.append("\n Customer Name :

"+resultSet.getString("name"));

39
area.append("\n Customer Meter Number:

"+resultSet.getString("meter_no"));

area.append("\n Customer Address :

"+resultSet.getString("address"));

area.append("\n Customer City : "+resultSet.getString("city"));

area.append("\n Customer State : "+resultSet.getString("state"));

area.append("\n Customer Email :

"+resultSet.getString("email"));

area.append("\n Customer Phone Number :

"+resultSet.getString("phone_no"));

package electricity.billing.system;

import javax.swing.*;

import java.awt.*;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

40
public class meterInfo extends JFrame implements ActionListener {

Choice meterLocCho, meterTypCho,phaseCodeCho,billtypCho;

JButton submit;

String meternumber;

meterInfo(String meternumber){

this.meternumber=meternumber;

JPanel panel = new JPanel();

panel.setLayout(null);

panel.setBackground(new Color(252,186,3));

add(panel);

JLabel heading =new JLabel("Meter Information");

heading.setBounds(180,10,200,20);

heading.setFont(new Font("Tahome",Font.BOLD,20));

panel.add(heading);

41
JLabel meterNumber = new JLabel("Meter Number");

meterNumber.setBounds(50,80,100,20);

panel.add(meterNumber);

JLabel meterNumberText = new JLabel(meternumber);

meterNumberText.setBounds(180,80,150,20);

panel.add(meterNumberText);

JLabel meterLoc = new JLabel("Meter Number");

meterLoc.setBounds(50,120,100,20);

panel.add(meterLoc);

meterLocCho =new Choice();

meterLocCho.add("Outside");

meterLocCho.add("Inside");

meterLocCho.setBounds(180,120,150,20);

42
panel.add(meterLocCho);

JLabel meterTyp = new JLabel("Meter Type");

meterTyp.setBounds(50,160,100,20);

panel.add(meterTyp);

meterTypCho =new Choice();

meterTypCho.add("Electric Meter");

meterTypCho.add("Solar Meter");

meterTypCho.add("Smart Meter");

meterTypCho.setBounds(180,160,150,20);

panel.add(meterTypCho);

JLabel phaseCode = new JLabel("Phase Code");

phaseCode.setBounds(50,200,100,20);

panel.add(phaseCode);

43
phaseCodeCho =new Choice();

phaseCodeCho.add("011");

phaseCodeCho.add("022");

phaseCodeCho.add("033");

phaseCodeCho.add("044");

phaseCodeCho.add("055");

phaseCodeCho.add("066");

phaseCodeCho.add("077");

phaseCodeCho.add("088");

phaseCodeCho.add("099");

phaseCodeCho.setBounds(180,200,150,20);

panel.add(phaseCodeCho);

JLabel billtyp = new JLabel("Bill Type");

billtyp.setBounds(50,240,100,20);

panel.add(billtyp);

44
billtypCho =new Choice();

billtypCho.add("Normal");

billtypCho.add("Industrial");

billtypCho.setBounds(180,240,150,20);

panel.add(billtypCho);

JLabel day = new JLabel("30 Days Billing Time...");

day.setBounds(50,280,150,20);

panel.add(day);

JLabel note = new JLabel("Note:-");

note.setBounds(50,320,100,20);

panel.add(note);

JLabel note1 = new JLabel("By default bill is calculated for 30 days

only");

note1.setBounds(50,340,300,20);

panel.add(note1);

submit = new JButton("Submit");

submit.setBounds(220,390,100,25);

45
submit.setBackground(Color.black);

submit.setForeground(Color.white);

submit.addActionListener(this);

panel.add(submit

setLayout(new BorderLayout());

add(panel,"Center");

ImageIcon i1 = new

ImageIcon(ClassLoader.getSystemResource("icon/details.png"));

Image i2 =

i1.getImage().getScaledInstance(230,200,Image.SCALE_DEFAULT);

ImageIcon i3 = new ImageIcon(i2);

JLabel imgLabel = new JLabel(i3);

add(imgLabel,"East");

setSize(700,500);

setLocation(400,200);

setVisible(true);

@Override

46
public void actionPerformed(ActionEvent e) {

if (e.getSource()==submit){

String smeterNum = meternumber;

String smeterLoc = meterLocCho.getSelectedItem();

String smeterTyp = meterTypCho.getSelectedItem();

String sphaseCode = phaseCodeCho.getSelectedItem();

String sbillTyp = billtypCho.getSelectedItem();

String sday ="30";

String query_meterInfo = "insert into meter_info

values('"+smeterNum+"','"+smeterLoc+"','"+smeterTyp+"','"+sphaseCode+"','"+

sbillTyp+"','"+sday+"')";

try{

database c= new database();

c.statement.executeUpdate(query_meterInfo);

JOptionPane.showMessageDialog(null,"Meter Information Submited

Successfully");

setVisible(false);

47
}catch (Exception E){

E.printStackTrace();

}else {

setVisible(false);

public static void main(String[] args) {

new meterInfo("");

package electricity.billing.system;

import javax.swing.*;

import java.awt.*;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.util.Random;

48
public class newCustomer extends JFrame implements ActionListener {

JLabel heading ,meternumText,customerName,meterNum,

address,city,state,email,phone;

JButton next, cancel;

TextField nameText, addressText, cityText, stateText ,emailText,phoneText;

newCustomer(){

super("New Customer");

setSize(700,500);

setLocation(400,200);

JPanel panel = new JPanel();

panel.setLayout(null);

panel.setBackground(new Color(252,186,3));

add(panel);

heading = new JLabel("New Customer");

heading.setBounds(180,10,200,20);

heading.setFont(new Font("Tahoma",Font.BOLD,20));

panel.add(heading);

49
customerName = new JLabel("New Customer");

customerName.setBounds(50,80,100,20);

panel.add(customerName);

nameText = new TextField();

nameText.setBounds(180,80,150,20);

panel.add(nameText);

meterNum = new JLabel("Meter Number");

meterNum.setBounds(50,120,100,20);

panel.add(meterNum);

meternumText = new JLabel("");

meternumText.setBounds(180,120,150,20);

pnel.add(meternumText);

Random ran = new Random();

long number = ran.nextLong() % 1000000;

meternumText.setText(""+ Math.abs(number) );

address = new JLabel("Address ");

50
address.setBounds(50,160,100,20);

panel.add(address);

addressText = new TextField();

addressText.setBounds(180,160,150,20);

panel.add(addressText);

city = new JLabel("City ");

city.setBounds(50,200,100,20);

panel.add(city);

cityText = new TextField();

cityText.setBounds(180,200,150,20);

panel.add(cityText);

state = new JLabel("State ");

state.setBounds(50,240,100,20);

paneladd(state);

stateText = new TextField();

stateText.setBounds(180,240,150,20);

51
panel.add(stateText);

email = new JLabel("Email ");

email.setBounds(50,280,100,20);

panel.add(email);

emailText = new TextField();

emailText.setBounds(180,280,150,20);

panel.add(emailText);

phone = new JLabel("Phone ");

phone.setBounds(50,320,100,20);

panel.add(phone);

phoneText = new TextField();

phoneText.setBounds(180,320,150,20);

panel.add(phoneText);

next = new JButton("Next");

next.setBounds(120,390,100,25);

next.setBackground(Color.black);

52
next.setForeground(Color.white);

next.addActionListener(this);

panel.add(next);

cancel = new JButton("Cancel");

cancel.setBounds(230,390,100,25);

cancel.setBackground(Color.black);

cancel.setForeground(Color.white);

cancel.addActionListener(this);

panel.add(cancel);

package electricity.billing.system;

import javax.swing.*;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

public class payment_bill extends JFrame implements ActionListener {

JButton back;

String meter;

payment_bill(String meter){

53
this.meter = meter;

JEditorPane j = new JEditorPane();

j.setEditable(false);

try{

j.setPage("https://paytm.com/online-payments");

j.setBounds(400,150,800,600);

}catch (Exception E){

E.printStackTrace();

j.setContentType("text/html");

j.setText("<html>Errorr! Errorr! Errorr! Errorr! Errorr! Errorr!

</html>");

JScrollPane pane = new JScrollPane(j);

add(pane);

back = new JButton("Back");

back.setBounds(640,20,80,30);

back.addActionListener(this);

j.add(back);

54
setSize(800,600);

setLocation(400,150);

setVisible(true);

@Override

public void actionPerformed(ActionEvent e) {

setVisible(false);

new pay_bill(meter);

public static void main(String[] args) {

new payment_bill("");

package electricity.billing.system;

55
import javax.swing.*;

import java.awt.*;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.awt.geom.RectangularShape;

import java.sql.ResultSet;

public class update_information extends JFrame implements ActionListener {

JLabel nametext;

JTextField addressText,cityText,stateText,emailText,phoneText;

String meter;

JButton update,cancel;

update_information(String meter){

this.meter=meter;

setBounds(400,150,777,450);

getContentPane().setBackground(new Color(229,255,227));

setLayout(null);

56
JLabel heading = new JLabel("Update Customer Information");

heading.setBounds(50,10,400,40);

heading.setFont(new Font("serif",Font.BOLD,20));

add(heading);

JLabel name = new JLabel("Name");

name.setBounds(30,70,100,20);

add(name);

nametext = new JLabel("");

nametext.setBounds(150,70,200,20);

add(nametext);

JLabel meterNo = new JLabel("Meter Number");

meterNo.setBounds(30,110,100,20);

add(meterNo);

57
JLabel meterText = new JLabel("");

meterText.setBounds(150,110,100,20);

add(meterText);

JLabel address = new JLabel("Address");

address.setBounds(30,150,100,20);

add(address);

addressText = new JTextField();

addressText.setBounds(150,150,200,20);

add(addressText);

JLabel city = new JLabel("City");

city.setBounds(30,190,100,20);

add(city);

58
cityText = new JTextField();

cityText.setBounds(150,190,200,20);

add(cityText);

JLabel state = new JLabel("State");

state.setBounds(30,230,100,20);

add(state);

stateText = new JTextField();

stateText.setBounds(150,230,200,20);

add(stateText);

JLabel email = new JLabel("Email");

email.setBounds(30,270,100,20);

add(email);

59
emailText = new JTextField();

emailText.setBounds(150,270,200,20);

add(emailText);

JLabel phone = new JLabel("Phone");

phone.setBounds(30,310,100,20);

add(phone);

phoneText = new JTextField();

phoneText.setBounds(150,310,200,20);

add(phoneText);

try{

database c = new database();

ResultSet resultSet = c.statement.executeQuery("select * from

new_customer where meter_no = '"+meter+"'");

if (resultSet.next()){

nametext.setText(resultSet.getString("name"));

60
meterText.setText(resultSet.getString("meter_no"));

addressText.setText(resultSet.getString("address"));

cityText.setText(resultSet.getString("city"));

stateText.setText(resultSet.getString("state"));

emailText.setText(resultSet.getString("email"));

phoneText.setText(resultSet.getString("phone_no"));

}catch (Exception e){

e.printStackTrace();

update = new JButton("Update");

update.setBackground(new Color(33,106,145));

update.setForeground(Color.white);

update.setBounds(50,360,120,25);

update.addActionListener(this);

add(update);

61
cancel = new JButton("Cancel");

cancel.setBackground(new Color(33,106,145));

cancel.setForeground(Color.white);

cancel.setBounds(200,360,120,25);

cancel.addActionListener(this);

add(cancel);

package electricity.billing.system;

import javax.swing.*;

import java.awt.*;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.security.cert.Extension;

import java.sql.ResultSet;

public class view_information extends JFrame implements ActionListener {

62
String view;

JButton cancel;

view_information(String view){

this.view = view;

setBounds(350,150,850,650);

getContentPane().setBackground(Color.WHITE);

setLayout(null);

JLabel heading = new JLabel("View Customer Information");

heading.setBounds(250,0,500,40);

heading.setFont(new Font("serif",Font.BOLD,20) );

add(heading);

JLabel nameLabel = new JLabel("Name");

nameLabel.setBounds(70,80,100,20);

add(nameLabel);

63
JLabel nameLabelText = new JLabel("");

nameLabelText.setBounds(200,80,150,20);

add(nameLabelText);

JLabel meterno = new JLabel("Meter Number");

meterno.setBounds(70,140,100,20);

add(meterno);

JLabel meternoText = new JLabel("");

meternoText.setBounds(200,140,150,20);

add(meternoText);

JLabel address = new JLabel("Address");

address.setBounds(70,200,100,20);

64
add(address);

JLabel addressText = new JLabel("");

addressText.setBounds(200,200,150,20);

add(addressText);

JLabel city = new JLabel("City");

city.setBounds(70,260,100,20);

add(city);

JLabel cityText = new JLabel("");

cityText.setBounds(200,260,150,20);

add(cityText);

JLabel state = new JLabel("State");

65
state.setBounds(500,80,100,20);

add(state);

JLabel stateText = new JLabel("");

stateText.setBounds(600,80,150,20);

add(stateText);

JLabel email = new JLabel("Email");

email.setBounds(500,140,100,20);

add(email);

JLabel emailText = new JLabel("");

emailText.setBounds(600,140,150,20);

add(emailText);

66
JLabel phone = new JLabel("phone");

phone.setBounds(500,200,100,20);

add(phone);

JLabel phoneText = new JLabel("");

phoneText.setBounds(600,200,150,20);

add(phoneText);

try{

database c = new database();

ResultSet resultSet = c.statement.executeQuery("select * from

new_customer where meter_no = '"+view+"'");

if (resultSet.next()){

nameLabelText.setText(resultSet.getString("name"));

meternoText.setText(resultSet.getString("meter_no"));

addressText.setText(resultSet.getString("address"));

cityText.setText(resultSet.getString("city"));

stateText.setText(resultSet.getString("state"));

67
emailText.setText(resultSet.getString("email"));

phoneText.setText(resultSet.getString("phone_no"));

}catch (Exception e){

e.printStackTrace();

cancel = new JButton("Cancel");

cancel.setBackground(new Color(24,118,242));

cancel.setForeground(Color.white);

cancel.setBounds(220,350,120,25);

cancel.addActionListener(this);

add(cancel);

ImageIcon a1 = new

ImageIcon(ClassLoader.getSystemResource("icon/viewInfo.png"));

Image a2 =

a1.getImage().getScaledInstance(600,300,Image.SCALE_DEFAULT);

68
ImageIcon i3 = new ImageIcon(a2);

JLabel img = new JLabel(i3);

img.setBounds(100,320,600,300);

add(img);

setVisible(true);

@Override

public void actionPerformed(ActionEvent e) {

if (e.getSource()==cancel){

setVisible(false);

public static void main(String[] args) {

new view_information("");

69
CHAPTER 5

RESULT AND DISCUSSION

5.1 RESULT IN JAVA

Output of the sign in page:

Fig 5.1 Output of the sign in page

72
Output of the login page:

Fig 5.2 Output of the login page

73
Output of the customer details page:

Fig 5.3 Output of the ordering page

74
Output of the bill slip details page:

75
Output of the bill update information page:

76
CHAPTER 6

CONCLUSION

After all the hard work is done for electricity bill management system

is here. It is a software which helps the user to work with the billing

cycles, paying bills, managing different DETAILS under which are

working etc.

This software reduces the amount of manual data entry and gives

greater efficiency. The User Interface of it is very friendly and can be

easily used by anyone.

It also decreases the amount of time taken to write details and other

modules.

78
CHAPTER 7

REFERENCE

Book Reference Database Management Systems 3rd Edition by

Raghu Ramakrishnan (TEXTBOOK).

80

You might also like