0% found this document useful (0 votes)
722 views25 pages

Private Void jButton1ActionPerformed

This document contains code for an airport management system with multiple classes and methods. It includes methods for: - Validating login credentials - Displaying and entering flight and customer details in databases - Calculating ticket prices and total amounts - Opening different forms like booking confirmation and payment options - Closing the application The code handles database connections, form visibility, input validation and other tasks for an airport management application.

Uploaded by

anon_119310228
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
722 views25 pages

Private Void jButton1ActionPerformed

This document contains code for an airport management system with multiple classes and methods. It includes methods for: - Validating login credentials - Displaying and entering flight and customer details in databases - Calculating ticket prices and total amounts - Opening different forms like booking confirmation and payment options - Closing the application The code handles database connections, form visibility, input validation and other tasks for an airport management application.

Uploaded by

anon_119310228
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 25

private void jButton1ActionPerformed(java.awt.event.

ActionEvent evt) {

String pwd=TF1.getText();

if

(pwd.equals("airport"))

FirstPage i=new FirstPage();

i.setVisible(true);

}
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt)
{

cust_details a=new cust_details();

a.setVisible(true);

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

FirstPage w=new FirstPage();

w.setVisible(true);

this.setVisible(false);

// TODO add your handling code here:


} private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)
{

try{//TODO add your handling code here:

Class.forName("com.mysql.jdbc.Driver").newInstance();

//DefaultTableModel model=(DefaultTableModel)jTable1.getModel();

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/test","ro
ot","scott");

Statement stmt=con.createStatement();

int sid=Integer.parseInt(jTextField1.getText());

String sname=jTextField2.getText();

String saddress=jTextField3.getText();

int smobile=Integer.parseInt(jTextField4.getText());

String sstate=jTextField5.getText();

String scity=jTextField6.getText();

int spin=Integer.parseInt(jTextField7.getText());

String query="insert into Airport


values('"+(sid)+"','"+(sname)+"','"+(saddress)+"','"+(smobile)+"','"+(sstate)+"','"+(sc
ity)+"','"+(spin)+"')";

JOptionPane.showMessageDialog(this,"record successfully entered");

int rowseffected=stmt.executeUpdate(query);

System.out.println(rowseffected+"rows effected");

} catch (Exception e)

JOptionPane.showMessageDialog(this, e.getMessage());

e.printStackTrace();
} // TODO add your handling code here:

} private void jButton4ActionPerformed(java.awt.event.ActionEvent evt)


{

System.exit(0);

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

Flight_Details q=new Flight_Details();

q.setVisible(true);

this.setVisible(false);
package airport_port_management;

import javax.swing.table.*;

import java.sql.*;

import javax.swing.JOptionPane;

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


try{//TODO add your handling code here:

Class.forName("com.mysql.jdbc.Driver").newInstance();

DefaultTableModel model=(DefaultTableModel)jTable1.getModel();

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/test","ro
ot","scott");

Statement stmt=con.createStatement();

String query="select * from flight";

ResultSet rs=stmt.executeQuery(query);

while (rs.next())

String FlightID=rs.getString("Flightid");

String FlightName=rs.getString("FlightName");

String Fromsource=rs.getString("Fromsource");

String TO=rs.getString("Todestination");

String DepartureTimefromSource=rs.getString("FlightDep");

String ArrivalTimeatdestination=rs.getString("flightarrival");

String Price=rs.getString("Price");

System.out.println(FlightID+" "+" "+FlightName+" "+Fromsource+" "+"


"+TO+" "+DepartureTimefromSource+" "+" "+ ArrivalTimeatdestination+"
"+Price);

model.addRow(new
Object[]{FlightID,FlightName,Fromsource,TO,DepartureTimefromSource,ArrivalTimeat
destination,Price});
}

rs.close();

stmt.close();

con.close();

} catch (Exception e){

JOptionPane.showMessageDialog(this, e.getMessage());

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

Third w=new Third();

w.setVisible(true);

this.setVisible(false);

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

cust_details r=new cust_details();

r.setVisible(true);

this.setVisible(false);

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

System.exit(0);

private void jButton5ActionPerformed(java.awt.event.ActionEvent evt)

{ price=TF3.getText();

Flightid=TF1.getText();
FlightName=TF2.getText();

System.out.println(Flightid);

System.out.println(FlightName);

System.out.println(price);// TODO add your handling code here:

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

Flight_Details m=new Flight_Details();

m.setVisible(true);

this.setVisible(false);

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

System.exit(0);

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

if (CB1.isSelected())

Economy w=new Economy();

w.setVisible(true);

this.setVisible(false);

if (CB2.isSelected())

First u=new First();

u.setVisible(true);

this.setVisible(false);

}
public static double pop;

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

Third c=new Third();

c.setVisible(true);

this.setVisible(false);

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

System.exit(0);
}

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

Total_Amount p=new Total_Amount();

p.setVisible(true);

this.setVisible(false);

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

int a,c,i,cost=0,m,trip=0;

a=Integer.parseInt(TF1.getText());

c=Integer.parseInt(TF2.getText());

i=Integer.parseInt(TF3.getText());

a=a*2500;

c=c*2000;

i=i*1500;

m=a+c+i;

TFT.setText(" "+m);

if(CB1.isSelected())

cost+=1000;

if(CB2.isSelected())

cost+=1500;
if(RB1.isSelected())

trip=2000;

if(RB2.isSelected())

trip=2500;

pop=trip+cost+m;

TF4.setText(" "+pop);

}
public static double tot;

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

Total_Amount h=new Total_Amount();

h.setVisible(true);

this.setVisible(false);

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


int a,c,i,cost=0,m,trip=0;

a=Integer.parseInt(TF1.getText());

c=Integer.parseInt(TF2.getText());

i=Integer.parseInt(TF3.getText());

a=Integer.parseInt(TF1.getText());

c=Integer.parseInt(TF2.getText());

i=Integer.parseInt(TF3.getText());

a=a*1500;

c=c*1000;

i=1500;

m=a+c+i;

TFT.setText(" "+m);

if(CB1.isSelected())

cost+=1000;

if(RB1.isSelected())

trip=1000;

if(RB2.isSelected())

trip=500;

tot=trip+cost+m;
TF4.setText(" "+tot);

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

Flight_Details r=new Flight_Details();

r.setVisible(true);

this.setVisible(false);

}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {

System.exit(0);

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

Flight_Details p=new Flight_Details();


p.setVisible(true);

this.setVisible(false);

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

Mode_Payment d=new Mode_Payment();

d.setVisible(true);

this.setVisible(false);

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

Flight_Details fd=new Flight_Details();

jTextField2.setText(""+fd.FlightName);

Flight_Details b=new Flight_Details();

jTextField3.setText(""+fd.Flightid);

Flight_Details c=new Flight_Details();

jTextField5.setText(""+fd.price);

int dis,total=0;

dis=50;

jTextField7.setText(" "+dis);

First f=new First();

jTextField4.setText(""+f.pop);

Economy y=new Economy();

jTextField1.setText(""+y.tot);

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

Total_Amount r=new Total_Amount();

r.setVisible(true);

this.setVisible(false);

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

Booking_Conformed s=new Booking_Conformed();


s.setVisible(true);

this.setVisible(false);

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

String mode,account;

mode= " ";

account=" ";

if (RB1.isSelected())

account="ICICI";

if (RB2.isSelected())

account="AXIS";

if (RB3.isSelected())

account="SBI";

if (RB4.isSelected())

mode="paytm";

if (RB5.isSelected())

mode="phonepay";

if (RB6.isSelected())

mode="bhim";

TF1.setText(mode);

TF2.setText(account);

}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {

Thanks o=new Thanks();

o.setVisible(true);

this.setVisible(false);

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

Total_Amount n=new Total_Amount();

n.setVisible(true);

this.setVisible(false); }
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

Booking_Conformed e=new Booking_Conformed();

e.setVisible(true);

this.setVisible(false);

private void jButton2ActionPerformed {

System.exit(0); }

You might also like