0% found this document useful (0 votes)
70 views24 pages

Airline Reservation System

The document describes the login page class of an airline reservation system project. It includes classes for buttons, tables, labels and mouse listeners to handle user interactions on the login page. The objective of the project is to implement the reservation system to better satisfy customers by providing easy access to flight information and reducing waiting times through automation of the booking process.
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)
70 views24 pages

Airline Reservation System

The document describes the login page class of an airline reservation system project. It includes classes for buttons, tables, labels and mouse listeners to handle user interactions on the login page. The objective of the project is to implement the reservation system to better satisfy customers by providing easy access to flight information and reducing waiting times through automation of the booking process.
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/ 24

INDEX

Topics

1. Login page ...3


◦ Login page class ...3
◦ Button class ...7
◦ mouse 1 class ...8
◦ mouse 3 class ...9
◦ mouse 2 class ...10
2. Domestic Flight ...11
◦ DomesticFlight class ...12
◦ button 3 class ...15
◦ Save2 class ...19
3. Print Ticket ...21

Page number 1/24


OBJECTIVE

The objective of this project is to implement the airline reservation system to the
best satisfaction of the customer. The normal process which was followed until
recently was to manually fill the data and then process the data which used to
cause a lot of inconvenience to the customers.

Expected Functionalities

1) Better customer satisfaction

2) Easy access to the information about airlines and flight timings

3) Easy maintenance of the databases by the administrator

4) Decrease the waiting time for each customer

5) Calculate the number of customers using the airlines

6) Maintenance of information regarding various customers

Page number 2/24


Login Page

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.text.*;
public class LoginPage extends JFrame
{
Container c = getContentPane();
JPanel PFlightTypes = new JPanel(null);
JPanel PLogin = new JPanel(null);

Page number 3/24


JPanel PFlightDetails = new JPanel(null);
public boolean bCheck=true;
JLabel LDomesticFlight = new JLabel("<html><B><I>Domestic
Flights</I></B></html>");
JLabel LUserName, LPassword;
JLabel LDomesticFlight1 = new JLabel("<html><B>Domestic Flight
Booking</B></html>");
JTextField TFUserName;
JPasswordField TPPassword;
JButton BLogin;
final Object[] col1 ={ "From", "To", "Price", "Time" };
final Object[] col2 = { "From", "To", "Price", "Time" };
final Object[] col3 = { "From", "To", "Price", "Time" };
final Object[][] row1 = { { "Trivandrum", "Bangalore", "3125", "16:30" },
{ "Trivandrum", "Chennai ", "3225", "19:00" }, { "Trivandrum", "Delhi", "1425 ",
"08:30" }, { "Trivandrum", "Goa", "1025 ", "09:50" }, { "Trivandrum",
"Hyderabad", "1525", "11:00" }, { "Trivandrum", "Kolkata", "3825 ", "05:30" },
{ "Trivandrum", "Lucknow", "3025", "05:30" }, { "Trivandrum", "Mumbai",
"1725", "12:00" }, { "Trivandrum", "Vishakapatnam", "3725", "19:00" } };
final Object[][] row2 = { { "Trivandrum", "Bali", "21485", "06:20" },
{ "Trivandrum", "Bangkok", "9000", "20:45" }, { "Trivandrum", "Cairo",
"22975", "10:25" }, { "Trivandrum", "CapeTown", "42500", "16:45" },
{ "Trivandrum", "Chicago", "35000", "06:30" }, { "Trivandrum", "Dubai",
"12000", "08:15" }, { "Trivandrum", "Frankfurt", "18500", "06:50" },
{ "Trivandrum", "HongKong", "20845", "12:00" }, { "Trivandrum", "Istanbul",
"22000", "10:45" }, { "Trivandrum", "London", "22600", "14:35" },
{ "Trivandrum", "LosAngeles", "35000", "22:00" }, { "Trivandrum",
"Melbourne", "27800", "21:15" }, { "Trivandrum", "New York", "32000",
"08:50" }, { "Trivandrum", "Paris", "18500", "18:45" }, { "Trivandrum", "Rome",
"19900", "20:00"}, { "Trivandrum", "SanFrancisco", "35000", "12:00"},
{ "Trivandrum", "shanghai", "24430", "10:15" }, { "Trivandrum", "Singapore",
"9000", "21:10" }, { "Trivandrum", "Sydney", "27800", "12:00"}, { "Trivandrum",
"Toronto", "35000", "17:00 " } };
final Object[][] row3 = { { "Trivandrum", "Bangalore", "9375", "16:30" },
{ "Trivandrum", "Chennai ", "9675", "19:00" }, { "Trivandrum", "Delhi", "4275",
"08:30" }, { "Trivandrum", "Goa", "3075", "09:50" }, { "Trivandrum",
"Hyderabad", "4575", "11:00" }, { "Trivandrum", "Kolkata", "11475", "05:30" }, {

Page number 4/24


"Trivandrum", "Lucknow", "9075", "05:30" }, { "Trivandrum", "Mumbai",
"5175", "12:00" }, { "Trivandrum", "Vishakapatnam", "11175", "19:00" } };
final Object[][] row4 = { { "Trivandrum", "Bali", "64455", "06:20" },
{ "Trivandrum", "Bangkok", "27000", "20:45" }, { "Trivandrum", "Cairo",
"68925", "10:25" }, { "Trivandrum", "CapeTown", "37500", "16:45" },
{ "Trivandrum", "Chicago", "105000", "06:30" }, { "Trivandrum", "Dubai",
"36000", "08:15" }, { "Trivandrum", "Frankfurt", "55500", "06:50" },
{ "Trivandrum", "HongKong", "62535", "12:00" }, { "Trivandrum", "Istanbul",
"66000", "10:45" }, { "Trivandrum", "London", "67800", "14:35" },
{ "Trivandrum", "LosAngeles", "105000", "22:00" }, { "Trivandrum",
"Melbourne", "83400", "21:15" }, { "Trivandrum", "New York", "96000",
"08:50" }, { "Trivandrum", "Paris", "55500", "18:45" }, { "Trivandrum", "Rome",
"59700", "20:00" }, { "Trivandrum", "SanFrancisco", "105000", "12:00" },
{ "Trivandrum", "shanghai", "73290", "10:15" }, { "Trivandrum", "Singapore",
"27000", "21:10"}, { "Trivandrum", "Sydney", "83400", "12:00"},
{ "Trivandrum", "Toronto", "105000", "17:00" } };
JTable TDomesticFlight = new JTable(row1, col1);
JTable TDomesticFlight1 = new JTable(row3, col3);
JScrollPane JSP1 = new JScrollPane(TDomesticFlight,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
JScrollPane JSP3 = new JScrollPane(TDomesticFlight1,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
Icon img1 = new ImageIcon("img/economic.jpg");
Icon img2 = new ImageIcon("img/business.jpg");
Icon img3 = new ImageIcon("img/economic1.jpg");
Icon img4 = new ImageIcon("img/business1.jpg");
JLabel LEconomic = new JLabel("Economic", img1, SwingConstants.LEFT);
JLabel LBusiness = new JLabel("Business", img2, SwingConstants.LEFT);
JLabel LEconomic1 = new JLabel("Economic", img3, SwingConstants.LEFT);
JLabel LBusiness1 = new JLabel("Business", img4, SwingConstants.LEFT);
public LoginPage()
{
setPreferredSize(new Dimension(796,572));
PFlightTypes.setBackground(Color.white);
PLogin.setBackground(Color.white);

Page number 5/24


PFlightDetails.setBackground(Color.white);
JSP1.setBounds(0, 340, 790, 200);
JSP3.setBounds(0, 340, 790, 200);
PFlightTypes.setBounds(0,0,500, 340);
PLogin.setBounds(500,0,350, 340);
PFlightDetails.setBounds(0,340,790,200);
LUserName = new JLabel(" User Name ");
LPassword = new JLabel(" Password ");
TFUserName = new JTextField(10);
TPPassword = new JPasswordField(10);
BLogin = new JButton("Sign In");
LUserName.setBounds(40, 100, 100, 21);
LPassword.setBounds(40, 140, 100, 21);
TFUserName.setBounds(160, 100, 100, 21);
TPPassword.setBounds(160, 140, 100, 21);
BLogin.setBounds(160, 200, 100,25);
LDomesticFlight1.setBounds(60, 60, 138, 20);
PLogin.add(LUserName);
PLogin.add(TFUserName);
PLogin.add(LPassword);
PLogin.add(TPPassword);
PLogin.add(BLogin);
PFlightDetails.add(JSP1);
PFlightDetails.add(JSP3);
JSP1.setVisible(true);
JSP3.setVisible(false);
LBusiness.setBounds(265, 170, 300, 125);
LEconomic.setBounds(0, 170, 250, 125);
LBusiness1.setBounds(280, 200, 135, 60);
LEconomic1.setBounds(50, 200, 147, 60);
PFlightTypes.add(LEconomic);
PFlightTypes.add(LBusiness);
PFlightTypes.add(LEconomic1);
PFlightTypes.add(LBusiness1);
LBusiness.setVisible(false);
LEconomic1.setVisible(false);
LBusiness1.setVisible(true);

Page number 6/24


LEconomic.setVisible(true);
LDomesticFlight.setBounds(60, 60, 100, 25);
c.add(PFlightTypes);
c.add(PLogin);
c.add(PFlightDetails);
PFlightTypes.add(LDomesticFlight);
pack();
setVisible(true);
LDomesticFlight.addMouseListener(new mouse1(this, true));
LDomesticFlight1.addMouseListener(new mouse3(this, true));
LBusiness1.addMouseListener(new mouse2(this, true));
LEconomic1.addMouseListener(new mouse2(this, false));
BLogin.addActionListener(new button1(this));
}
public static void main(String args[])
{
new LoginPage();
}
}
class button1 implements ActionListener
{
LoginPage type;
char[] cCheck, cPassword={'d','e','m','o','\0'};
JFrame f;
String sCheck,sCheck1="demo";
public button1(LoginPage type)
{
this.type = type;
}
public void actionPerformed(ActionEvent e)
{
cCheck=type.TPPassword.getPassword();
sCheck = type.TFUserName.getText();
if ((sCheck1.equals(sCheck)) && check())
{
type.PLogin.add(type.LDomesticFlight1);
type.PLogin.remove(type.LUserName);

Page number 7/24


type.PLogin.remove(type.TFUserName);
type.PLogin.remove(type.LPassword);
type.PLogin.remove(type.TPPassword);
type.PLogin.remove(type.BLogin);
type.c.repaint();
}
else
{
JOptionPane.showMessageDialog(null, "Invalid username or password. Try
again");
}
}
public boolean check()
{
if (cCheck.length >= 5 || cCheck.length < 4)
return false;
for(int i=0;i<4;i++)
{
if(cCheck[i]!=cPassword[i])
return false;
}
return true;
}
}
class mouse1 extends MouseAdapter
{
LoginPage type;
boolean bCheck;
public mouse1(LoginPage type, boolean bCheck)
{
this.type = type;
this.bCheck = bCheck;
}
public void mouseEntered(MouseEvent e)
{
type.LDomesticFlight.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CUR
SOR));

Page number 8/24


}
public void mouseClicked(MouseEvent e)
{
if(bCheck)
type.bCheck = true;
else
type.bCheck = false;
type.LEconomic.setVisible(true);
type.LBusiness1.setVisible(true);
type.LEconomic1.setVisible(false);
type.LBusiness.setVisible(false);
type.JSP1.setVisible(false);
type.JSP3.setVisible(false);
if(bCheck)
type.JSP1.setVisible(true);
}
}
class mouse3 extends MouseAdapter
{
LoginPage type;
boolean bCheck;
public mouse3(LoginPage type, boolean bCheck)
{
this.type = type;
this.bCheck = bCheck;
}
public void mouseEntered(MouseEvent e)
{
type.LDomesticFlight1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CU
RSOR));
}
public void mouseClicked(MouseEvent e)
{
if (bCheck)
new DomesticFlight(type);
}
}

Page number 9/24


class mouse2 extends MouseAdapter
{
LoginPage type;
boolean bCheck;
public mouse2(LoginPage type, boolean bCheck)
{
this.type = type;
this.bCheck = bCheck;
}
public void mouseEntered(MouseEvent e)
{
type.LEconomic1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSO
R));
type.LBusiness1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)
);
}
public void mouseClicked(MouseEvent e)
{
if(type.bCheck)
{
if (bCheck)
{
type.LBusiness1.setVisible(false);
type.LBusiness.setVisible(true);
type.LEconomic.setVisible(false);
type.LEconomic1.setVisible(true);
type.JSP1.setVisible(false);
type.JSP3.setVisible(true);
}
else
{
type.LEconomic1.setVisible(false);
type.LBusiness.setVisible(false);
type.LBusiness1.setVisible(true);
type.LEconomic.setVisible(true);
type.JSP1.setVisible(true);
type.JSP3.setVisible(true);

Page number 10/24


}
}
else
{
if (bCheck)
{
type.LBusiness1.setVisible(false);
type.LBusiness.setVisible(true);
type.LEconomic.setVisible(false);
type.LEconomic1.setVisible(true);
type.JSP1.setVisible(false);
type.JSP3.setVisible(false);
}
else
{
type.LEconomic1.setVisible(false);
type.LBusiness.setVisible(false);
type.LBusiness1.setVisible(true);
type.LEconomic.setVisible(true);
type.JSP1.setVisible(false);
type.JSP3.setVisible(false);
}
}
}
}

Domestic Flight

Page number 11/24


import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class DomesticFlight extends JFrame
{
JComboBox CBFrom, CBTo, CBClass, CBAdult, CBChildren, CBInfant;
JLabel LFrom, LTo, LBookingDate, LClass, LAdult, LChildren, LInfant,
LBookingDetails, LPassengerDetails, LDate, LImg1, LImg2, LNotes;
JTextField TFBookingDate;
Icon img1, img2;
JButton BFindFlight;
JPanel PPanel1, PPanel2;
LoginPage type1;

Page number 12/24


public DomesticFlight(LoginPage type1)
{
Container c =getContentPane();
c.setLayout(new BorderLayout());
String[] sItem1={"Trivandrum"};
String[] sItem2 ={ "Bangalore", "Chennai ", "Delhi", "Goa", "Hyderabad",
"Kolkata", "Lucknow", "Mumbai", "Vishakapatnam" };
String[] sItem3={"Economic","Business"};
this.type1 = type1;
PPanel1 = new JPanel(null);
PPanel1.setPreferredSize(new Dimension(500,200));
LBookingDetails = new JLabel("<html><b><font color=\"#C71585\">Booking
Details</font></b></html>");
LFrom = new JLabel("From :");
LTo = new JLabel("To :");
LBookingDate = new JLabel("Booking Date:");
LClass = new JLabel("Class :");
CBFrom = new JComboBox(sItem1);
CBTo = new JComboBox(sItem2);
CBClass = new JComboBox(sItem3);
TFBookingDate = new JTextField(10);
LDate = new JLabel("(DD/MM/YYYY)");
LDate.setForeground(Color.red);
img1=new ImageIcon("map1.jpg");
LImg1 = new JLabel(img1);
BFindFlight = new JButton("Find Flight");
LBookingDetails.setBounds(20,3,100,20);
LFrom.setBounds(20,40,100,20);
CBFrom.setBounds(100,40,100,20);
LTo.setBounds(20,100,100,20);
CBTo.setBounds(100,100,100,20);
LBookingDate.setBounds(14,160,100,20);
TFBookingDate.setBounds(100,160,100,20);
LDate.setBounds(210,160,100,20);
LClass.setBounds(20,220,100,20);
CBClass.setBounds(100,220,100,20);
BFindFlight.setBounds(50,270,100,25);

Page number 13/24


LImg1.setBounds(0,290,495,260);
PPanel1.add(LBookingDetails);
PPanel1.add(LFrom);
PPanel1.add(CBFrom);
PPanel1.add(LTo);
PPanel1.add(CBTo);
PPanel1.add(LBookingDate);
PPanel1.add(TFBookingDate);
PPanel1.add(LDate);
PPanel1.add(LClass);
PPanel1.add(CBClass);
PPanel1.add(BFindFlight);
PPanel1.add(LImg1);
PPanel1.setBackground(Color.white);
c.add(PPanel1,BorderLayout.WEST);
PPanel2 = new JPanel(null);
PPanel2.setPreferredSize(new Dimension(320,160));
LPassengerDetails=new JLabel("<html><b><font
color=\"#C71585\">PassengerDetails</font></b></html>");
LAdult = new JLabel("Adults(12+)");
LChildren = new JLabel("Children(2-11)");
LInfant = new JLabel("Infants(under 2)");
String[] item4={"1","2","3","4","5","6"};
CBAdult = new JComboBox(item4);
String[] item5={"0","1","2","3","4"};
CBChildren = new JComboBox(item5);
String[] item6={"0","1","2","3"};
CBInfant = new JComboBox(item6);
img2 = new ImageIcon("note_bg.gif");
LImg2 = new JLabel(img2);
LNotes = new JLabel("<html><body><p>NOTE: Bookings with International
Credit Cards <p> have temporarily been suspended.This Service<p> will resume
shortly and we will have a notice<p> posted on our website.We regret any
<p>inconvenience caused to our passengers.</body></html>");
LPassengerDetails.setBounds(40,3,100,20);
LAdult.setBounds(40,40,100,20);
CBAdult.setBounds(140,40,100,20);

Page number 14/24


LChildren.setBounds(40,105,100,20);
CBChildren.setBounds(140,105,100,20);
LInfant.setBounds(40,170,100,20);
CBInfant.setBounds(140,170,100,20);
LImg2.setBounds(16,220,320,200);
LNotes.setBounds(55,240,380,180);
PPanel2.add(LPassengerDetails);
PPanel2.add(LAdult);
PPanel2.add(LChildren);
PPanel2.add(LInfant);
PPanel2.add(CBAdult);
PPanel2.add(CBChildren);
PPanel2.add(CBInfant);
PPanel2.add(LNotes);
PPanel2.add(LImg2);
PPanel2.setBackground(Color.white);
c.add(PPanel2,BorderLayout.EAST);
setSize(795,580);
setVisible(true);
BFindFlight.addActionListener(new button3(this, type1));
}
public static void main(String args[])
{
LoginPage type1=null;
new DomesticFlight(type1);
}
}
class button3 implements ActionListener
{
DomesticFlight type;
LoginPage type1;
button3(DomesticFlight type, LoginPage type1)
{
this.type = type;
this.type1 = type1;
}
public void actionPerformed(ActionEvent e)

Page number 15/24


{
String sFrom = (String)type.CBFrom.getSelectedItem();
String sTo = (String)type.CBTo.getSelectedItem();
String sClass = (String)type.CBClass.getSelectedItem();
String sBookingDate = type.TFBookingDate.getText();
Integer iPrice=0;
String sTime="";
Integer iAdult = Integer.parseInt((String)type.CBAdult.getSelectedItem());
Integer iChildren = Integer.parseInt((String)type.CBChildren.getSelectedItem());
Integer iInfant = Integer.parseInt((String)type.CBInfant.getSelectedItem());
int i = 0;
if(sClass.equals("Economic"))
{
try{
while(i<20)
{
if(type1.row1[i][1].equals(sTo))
{
iPrice = Integer.parseInt((String)type1.row1[i][2]);
sTime = (String)type1.row1[i][3];
break;
}
i++;
}
}catch(Exception e1)
{
JOptionPane.showMessageDialog(null, "You have no rights to access");
System.out.println("Error: "+e1);
System.exit(0);
}
}
else
{
try
{
while(i<20)
{

Page number 16/24


if(type1.row1[i][1].equals(sTo))
{
iPrice = Integer.parseInt((String)type1.row3[i][2]);
sTime = (String)type1.row3[i][3];
break;
}
i++;
}
}catch(Exception e1)
{
JOptionPane.showMessageDialog(null, "You have no rights to access it");
System.exit(0);
}
}
type.setTitle(iPrice + " " + sTime);
iPrice = (iPrice*iAdult)+(iPrice*(iChildren/2));
int iCount=0;
int iSeatCount=0;
String[] sTempFrom=new String[1250];
String[] sTempTo=new String[1250];
String[] sTempClass=new String[1250];
String[] sTempBookingDate=new String[1250];
String[] sTempTime=new String[1250];
Integer[] iTempAdult=new Integer[1250];
Integer[] iTempChildren=new Integer[1250];
Integer[] iTempInfant=new Integer[1250];
Integer[] iTempPrice=new Integer[1250];
try
{
//read from data
Save2 save1;
ObjectInputStream OIS1 = new ObjectInputStream(new
FileInputStream("save2"));
do
{
save1 = (Save2)OIS1.readObject();
sTempFrom[iCount] = save1.sFrom;

Page number 17/24


sTempTo[iCount] = save1.sTo;
sTempClass[iCount] = save1.sClass;
sTempBookingDate[iCount] = save1.sBookingDate;
sTempTime[iCount] = save1.sTime;
iTempAdult[iCount] = save1.iAdult;
iTempChildren[iCount] = save1.iChildren;
iTempInfant[iCount] = save1.iInfant;
iTempPrice[iCount] = save1.iPrice;
iCount++;
if(save1.sBookingDate.equals(sBookingDate))
if(save1.sTo.equals(sTo))
iSeatCount=iSeatCount + save1.iAdult + save1.iChildren + save1.iInfant;
}while(save1!=null);
OIS1.close();
}
catch(Exception e1)
{
}
iSeatCount = iSeatCount + iAdult + iChildren + iInfant;
if(iSeatCount > 60)
{
JOptionPane.showMessageDialog(null,"Seats are full. Sorry!");
}
else
{
int iChoice = JOptionPane.showConfirmDialog(null,"Seats available. Do you
want to Book now?");
if(iChoice == JOptionPane.YES_OPTION)
{
new PrintTicket1(sFrom, sTo, sClass, iAdult, iChildren, iInfant, sBookingDate,
iPrice, sTime);
try
{
//write into data
Save2 save2=new Save2(sFrom, sTo, sClass, iAdult, iChildren, iInfant,
sBookingDate, iPrice, sTime);

Page number 18/24


ObjectOutputStream OOS1 = new ObjectOutputStream(new
FileOutputStream("save2"));
for(i=0;i<iCount;i++)
{
Save2 temp1=new Save2(sTempFrom[i], sTempTo[i], sTempClass[i],
iTempAdult[i], iTempChildren[i], iTempInfant[i], sTempBookingDate[i],
iTempPrice[i], sTempTime[i]);
OOS1.writeObject(temp1);
System.out.println(temp1);
}
OOS1.writeObject(save2);
OOS1.close();
}catch(Exception e1)
{
System.out.println(e1);
}
}
else
{
}
}
}
}
class Save2 implements Serializable
{
String sFrom, sTo, sClass, sBookingDate, sTime;
Integer iPrice, iAdult, iChildren, iInfant;
// int iCount;
public Save2(String sFrom, String sTo, String sClass, Integer iAdult, Integer
iChildren, Integer iInfant, String sBookingDate, Integer iPrice, String sTime)
{
this.sFrom=sFrom;
this.sTo=sTo;
this.sClass=sClass;
this.iAdult=iAdult;
this.iChildren=iChildren;
this.iInfant=iInfant;

Page number 19/24


this.sBookingDate=sBookingDate;
this.iPrice=iPrice;
this.sTime=sTime;
// this.iCount = iCount;
}
public String toString()
{
return sFrom+" "+sTo+" "+sClass+" "+iAdult+" "+iChildren+" "+iInfant+"
"+sBookingDate+" "+iPrice+" "+sTime;
}
}

Page number 20/24


Print Ticket

Page number 21/24


import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class PrintTicket1 extends JFrame
{
public PrintTicket1(String sFrom, String sTo, String sClass, Integer iAdult, Integer
iChildren, Integer iInfant, String sBookingDate, Integer iPrice, String sTime)
{
Container c=getContentPane();
c.setLayout(new BorderLayout());
JPanel Panel2 = new JPanel(null);
Panel2.setPreferredSize(new Dimension(500,200));
JLabel LTitle = new JLabel("<html><b><font
color=\"#C71585\",size=\"7\">AirLine Ticket</font></b></html>");
JLabel LFrom = new JLabel("<html><b><font color=\"#000000\">From &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;: &nbsp;</font></b><font color=\"#778899\">"+
sFrom+"</font></html>" );
JLabel LTo = new JLabel("<html><font color=\"#000000\">To &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;: &nbsp;</font><font
color=\"#778899\">"+sTo+"</font></html>");
JLabel LClass = new JLabel("<html><font color=\"#000000\">Class &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;: &nbsp;</font><font
color=\"#778899\">"+sClass+"</font></html>" );
JLabel LBookingDate = new JLabel("<html><font color=\"#000000\">Traveling
Date &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:&nbsp;</font><font
color=\"#778899\">"+ sBookingDate+"</font></html>" );
JLabel LPrice = new JLabel("<html><font color=\"#000000\">Total Price &nbsp;
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;:&nbsp;</font><font color=\"#778899\">"+ iPrice+"</font></html>" );
JLabel LTime = new JLabel("<html><font color=\"#000000\">DepatureTime
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:&nbsp;</font><font
color=\"#778899\">"+ sTime+"</font></html>" );

Page number 22/24


JLabel LAdult = new JLabel("<html><font color=\"#000000\">Adult &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;&nbsp; &nbsp;: &nbsp;</font><font
color=\"#778899\">"+iAdult+"</font></html>" );
JLabel LChildren = new JLabel("<html><font color=\"#000000\">Children
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :
&nbsp;</font><font color=\"#778899\">"+ iChildren+"</font></html>" );
JLabel LInfant = new JLabel("<html><font color=\"#000000\">Infant &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;: &nbsp;</font><font
color=\"#778899\">"+iInfant+"</font></html>" );
JLabel LWishes = new JLabel("<html><body><I><font
color=\"#D2B48C\">Wish you a happy journy</font></I></body></html>");
// JLabel LTicketNo=new JLabel("<html><font color=\"#000000\">TicketNumber
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: &nbsp;</font></html>");
// JLabel LBookedBy=new JLabel("<html><font color=\"#000000\">BookedBy
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:
&nbsp;</font></html>");
JLabel LEmpty = new
JLabel("-----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------");
JLabel LDemo = new JLabel("<html><U><font color=\"#8FBC8F\">AirLine-
Project Developed By</font></U></html>");
JLabel LRes=new JLabel("<html><I><font color=\"#8FBC8F\">Airline
Reservation</font></I></html>");
JLabel LFranklin=new JLabel("<html><I><font color=\"#8FBC8F >Shashank
singh bisht </font></I></html>");
LTitle.setBounds(170,15,500,45);
LFrom.setBounds(20,80,300,20);
LTo.setBounds(20,125,300,20);
LClass.setBounds(20,170,300,20);
LBookingDate.setBounds(20,215,300,20);
LPrice.setBounds(20,260,300,20);
LTime.setBounds(20,305,300,20);
LAdult.setBounds(20,345,300,20);
LChildren.setBounds(20,385,300,20);
LInfant.setBounds(20,430,300,20);

Page number 23/24


LWishes.setBounds(530,435,300,20);
// LTicketNo.setBounds(320,80,300,20);
// LBookedBy.setBounds(320,125,300,20);
LEmpty.setBounds(3,445,1000,20);
LDemo.setBounds(280,465,300,20);
LRes.setBounds(285,485,300,20);
LFranklin.setBounds(285,505,500,20);
Panel2.add(LTitle);
Panel2.add(LFrom);
Panel2.add(LTo);
Panel2.add(LClass);
Panel2.add(LBookingDate);
Panel2.add(LAdult);
Panel2.add(LChildren);
Panel2.add(LInfant);
Panel2.add(LPrice);
Panel2.add(LTime);
//Panel2.add(LEmpty);
Panel2.add(LWishes);
// Panel2.add(LTicketNo);
// Panel2.add(LBookedBy);
Panel2.add(LEmpty);
Panel2.add(LDemo);
Panel2.add(LRes);
Panel2.add(LFranklin);
Panel2.setBackground(Color.white);
c.add(Panel2, BorderLayout.CENTER);
//pack();
setSize(700,650);
setVisible(true);
}
}

Page number 24/24

You might also like