├── .gitattributes ├── DomesticFlight.class ├── DomesticFlight.java ├── ExitListener.class ├── ExitListener.java ├── InternationalFlight.class ├── InternationalFlight.java ├── LoginPage.class ├── LoginPage.java ├── PrintTicket1.class ├── PrintTicket1.java ├── README.md ├── Save1.class ├── Save2.class ├── WindowUtilities.class ├── WindowUtilities.java ├── airline project.pdf ├── button1.class ├── button2.class ├── button3.class ├── img ├── Thumbs.db ├── business.jpg ├── business1.JPG ├── economic.jpg └── economic1.JPG ├── map1.jpg ├── mouse1.class ├── mouse2.class ├── mouse3.class ├── note_bg.gif ├── readme.txt └── save2 /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /DomesticFlight.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/DomesticFlight.class -------------------------------------------------------------------------------- /DomesticFlight.java: -------------------------------------------------------------------------------- 1 | import javax.swing.*; 2 | import java.awt.*; 3 | import java.awt.event.*; 4 | import java.io.*; 5 | 6 | public class DomesticFlight extends JFrame 7 | { 8 | JComboBox CBFrom, CBTo, CBClass, CBAdult, CBChildren, CBInfant; 9 | JLabel LFrom, LTo, LBookingDate, LClass, LAdult, LChildren, LInfant, LBookingDetails, LPassengerDetails, LDate, LImg1, LImg2, LNotes; 10 | JTextField TFBookingDate; 11 | Icon img1, img2; 12 | JButton BFindFlight; 13 | JPanel PPanel1, PPanel2; 14 | 15 | LoginPage type1; 16 | 17 | public DomesticFlight(LoginPage type1) 18 | { 19 | Container c =getContentPane(); 20 | c.setLayout(new BorderLayout()); 21 | String[] sItem1={"Trivandrum"}; 22 | String[] sItem2 ={ "Bangalore", "Chennai ", "Delhi", "Goa", "Hyderabad", "Kolkata", "Lucknow", "Mumbai", "Vishakapatnam" }; 23 | String[] sItem3={"Economic","Business"}; 24 | 25 | this.type1 = type1; 26 | PPanel1 = new JPanel(null); 27 | PPanel1.setPreferredSize(new Dimension(500,200)); 28 | 29 | LBookingDetails = new JLabel("Booking Details"); 30 | LFrom = new JLabel("From :"); 31 | LTo = new JLabel("To :"); 32 | LBookingDate = new JLabel("Booking Date:"); 33 | LClass = new JLabel("Class :"); 34 | 35 | CBFrom = new JComboBox(sItem1); 36 | CBTo = new JComboBox(sItem2); 37 | CBClass = new JComboBox(sItem3); 38 | 39 | TFBookingDate = new JTextField(10); 40 | LDate = new JLabel("(DD/MM/YYYY)"); 41 | LDate.setForeground(Color.red); 42 | 43 | img1=new ImageIcon("map1.jpg"); 44 | LImg1 = new JLabel(img1); 45 | 46 | BFindFlight = new JButton("Find Flight"); 47 | 48 | LBookingDetails.setBounds(20,3,100,20); 49 | 50 | LFrom.setBounds(20,40,100,20); 51 | CBFrom.setBounds(100,40,100,20); 52 | 53 | LTo.setBounds(20,100,100,20); 54 | CBTo.setBounds(100,100,100,20); 55 | 56 | LBookingDate.setBounds(14,160,100,20); 57 | TFBookingDate.setBounds(100,160,100,20); 58 | LDate.setBounds(210,160,100,20); 59 | 60 | LClass.setBounds(20,220,100,20); 61 | CBClass.setBounds(100,220,100,20); 62 | 63 | BFindFlight.setBounds(50,270,100,25); 64 | 65 | LImg1.setBounds(0,290,495,260); 66 | 67 | PPanel1.add(LBookingDetails); 68 | PPanel1.add(LFrom); 69 | PPanel1.add(CBFrom); 70 | PPanel1.add(LTo); 71 | PPanel1.add(CBTo); 72 | PPanel1.add(LBookingDate); 73 | PPanel1.add(TFBookingDate); 74 | PPanel1.add(LDate); 75 | PPanel1.add(LClass); 76 | PPanel1.add(CBClass); 77 | PPanel1.add(BFindFlight); 78 | PPanel1.add(LImg1); 79 | PPanel1.setBackground(Color.white); 80 | 81 | c.add(PPanel1,BorderLayout.WEST); 82 | 83 | PPanel2 = new JPanel(null); 84 | PPanel2.setPreferredSize(new Dimension(320,160)); 85 | 86 | LPassengerDetails=new JLabel("PassengerDetails"); 87 | 88 | LAdult = new JLabel("Adults(12+)"); 89 | 90 | LChildren = new JLabel("Children(2-11)"); 91 | LInfant = new JLabel("Infants(under 2)"); 92 | 93 | String[] item4={"1","2","3","4","5","6"}; 94 | CBAdult = new JComboBox(item4); 95 | 96 | String[] item5={"0","1","2","3","4"}; 97 | CBChildren = new JComboBox(item5); 98 | 99 | String[] item6={"0","1","2","3"}; 100 | CBInfant = new JComboBox(item6); 101 | 102 | img2 = new ImageIcon("note_bg.gif"); 103 | LImg2 = new JLabel(img2); 104 | LNotes = new JLabel("

NOTE: Bookings with International Credit Cards

have temporarily been suspended.This Service

will resume shortly and we will have a notice

posted on our website.We regret any

inconvenience caused to our passengers."); 105 | 106 | LPassengerDetails.setBounds(40,3,100,20); 107 | 108 | LAdult.setBounds(40,40,100,20); 109 | CBAdult.setBounds(140,40,100,20); 110 | 111 | LChildren.setBounds(40,105,100,20); 112 | CBChildren.setBounds(140,105,100,20); 113 | 114 | LInfant.setBounds(40,170,100,20); 115 | CBInfant.setBounds(140,170,100,20); 116 | 117 | LImg2.setBounds(16,220,320,200); 118 | LNotes.setBounds(55,240,380,180); 119 | 120 | PPanel2.add(LPassengerDetails); 121 | PPanel2.add(LAdult); 122 | PPanel2.add(LChildren); 123 | PPanel2.add(LInfant); 124 | PPanel2.add(CBAdult); 125 | PPanel2.add(CBChildren); 126 | PPanel2.add(CBInfant); 127 | 128 | PPanel2.add(LNotes); 129 | PPanel2.add(LImg2); 130 | 131 | PPanel2.setBackground(Color.white); 132 | 133 | c.add(PPanel2,BorderLayout.EAST); 134 | 135 | setSize(795,580); 136 | setVisible(true); 137 | 138 | BFindFlight.addActionListener(new button3(this, type1)); 139 | } 140 | public static void main(String args[]) 141 | { 142 | LoginPage type1=null; 143 | new DomesticFlight(type1); 144 | } 145 | } 146 | 147 | class button3 implements ActionListener 148 | { 149 | DomesticFlight type; 150 | LoginPage type1; 151 | button3(DomesticFlight type, LoginPage type1) 152 | { 153 | this.type = type; 154 | this.type1 = type1; 155 | } 156 | public void actionPerformed(ActionEvent e) 157 | { 158 | String sFrom = (String)type.CBFrom.getSelectedItem(); 159 | String sTo = (String)type.CBTo.getSelectedItem(); 160 | String sClass = (String)type.CBClass.getSelectedItem(); 161 | String sBookingDate = type.TFBookingDate.getText(); 162 | Integer iPrice=0; 163 | String sTime=""; 164 | 165 | 166 | Integer iAdult = Integer.parseInt((String)type.CBAdult.getSelectedItem()); 167 | Integer iChildren = Integer.parseInt((String)type.CBChildren.getSelectedItem()); 168 | Integer iInfant = Integer.parseInt((String)type.CBInfant.getSelectedItem()); 169 | 170 | int i = 0; 171 | 172 | if(sClass.equals("Economic")) 173 | { 174 | try{ 175 | while(i<20) 176 | { 177 | if(type1.row1[i][1].equals(sTo)) 178 | { 179 | iPrice = Integer.parseInt((String)type1.row1[i][2]); 180 | sTime = (String)type1.row1[i][3]; 181 | break; 182 | } 183 | i++; 184 | } 185 | }catch(Exception e1) 186 | { 187 | JOptionPane.showMessageDialog(null, "You have no rights to access"); 188 | System.exit(0); 189 | } 190 | } 191 | else 192 | { 193 | try 194 | { 195 | while(i<20) 196 | { 197 | if(type1.row1[i][1].equals(sTo)) 198 | { 199 | iPrice = Integer.parseInt((String)type1.row3[i][2]); 200 | sTime = (String)type1.row3[i][3]; 201 | break; 202 | } 203 | i++; 204 | } 205 | }catch(Exception e1) 206 | { 207 | JOptionPane.showMessageDialog(null, "You have no rights to access it"); 208 | System.exit(0); 209 | } 210 | } 211 | type.setTitle(iPrice + " " + sTime); 212 | 213 | iPrice = (iPrice*iAdult)+(iPrice*(iChildren/2)); 214 | 215 | int iCount=0; 216 | int iSeatCount=0; 217 | 218 | String[] sTempFrom=new String[1250]; 219 | String[] sTempTo=new String[1250]; 220 | String[] sTempClass=new String[1250]; 221 | String[] sTempBookingDate=new String[1250]; 222 | String[] sTempTime=new String[1250]; 223 | Integer[] iTempAdult=new Integer[1250]; 224 | Integer[] iTempChildren=new Integer[1250]; 225 | Integer[] iTempInfant=new Integer[1250]; 226 | Integer[] iTempPrice=new Integer[1250]; 227 | 228 | try 229 | { 230 | //read from data 231 | Save2 save1; 232 | ObjectInputStream OIS1 = new ObjectInputStream(new FileInputStream("save2")); 233 | do 234 | { 235 | save1 = (Save2)OIS1.readObject(); 236 | sTempFrom[iCount] = save1.sFrom; 237 | sTempTo[iCount] = save1.sTo; 238 | sTempClass[iCount] = save1.sClass; 239 | sTempBookingDate[iCount] = save1.sBookingDate; 240 | sTempTime[iCount] = save1.sTime; 241 | iTempAdult[iCount] = save1.iAdult; 242 | iTempChildren[iCount] = save1.iChildren; 243 | iTempInfant[iCount] = save1.iInfant; 244 | iTempPrice[iCount] = save1.iPrice; 245 | 246 | iCount++; 247 | if(save1.sBookingDate.equals(sBookingDate)) 248 | if(save1.sTo.equals(sTo)) 249 | iSeatCount=iSeatCount + save1.iAdult + save1.iChildren + save1.iInfant; 250 | }while(save1!=null); 251 | OIS1.close(); 252 | 253 | } 254 | catch(Exception e1) 255 | { 256 | } 257 | 258 | iSeatCount = iSeatCount + iAdult + iChildren + iInfant; 259 | 260 | if(iSeatCount > 60) 261 | { 262 | JOptionPane.showMessageDialog(null,"Seats are full. Sorry!"); 263 | } 264 | else 265 | { 266 | int iChoice = JOptionPane.showConfirmDialog(null,"Seats available. Do you want to Book now?"); 267 | if(iChoice == JOptionPane.YES_OPTION) 268 | { 269 | new PrintTicket1(sFrom, sTo, sClass, iAdult, iChildren, iInfant, sBookingDate, iPrice, sTime); 270 | try 271 | { 272 | //write into data 273 | Save2 save2=new Save2(sFrom, sTo, sClass, iAdult, iChildren, iInfant, sBookingDate, iPrice, sTime); 274 | ObjectOutputStream OOS1 = new ObjectOutputStream(new FileOutputStream("save2")); 275 | for(i=0;iBooking Details"); 30 | LFrom = new JLabel("From :"); 31 | LTo = new JLabel("To :"); 32 | LBookingDate = new JLabel("Booking Date:"); 33 | LClass = new JLabel("Class :"); 34 | 35 | CBFrom = new JComboBox(sItem1); 36 | CBTo = new JComboBox(sItem2); 37 | CBClass = new JComboBox(sItem3); 38 | 39 | TFBookingDate = new JTextField(10); 40 | LDate = new JLabel("(DD/MM/YYYY)"); 41 | LDate.setForeground(Color.red); 42 | 43 | img1=new ImageIcon("map1.jpg"); 44 | LImg1 = new JLabel(img1); 45 | 46 | BFindFlight = new JButton("Find Flight"); 47 | 48 | LBookingDetails.setBounds(20,3,100,20); 49 | 50 | LFrom.setBounds(20,40,100,20); 51 | CBFrom.setBounds(100,40,100,20); 52 | 53 | LTo.setBounds(20,100,100,20); 54 | CBTo.setBounds(100,100,100,20); 55 | 56 | LBookingDate.setBounds(14,160,100,20); 57 | TFBookingDate.setBounds(100,160,100,20); 58 | LDate.setBounds(210,160,100,20); 59 | 60 | LClass.setBounds(20,220,100,20); 61 | CBClass.setBounds(100,220,100,20); 62 | 63 | BFindFlight.setBounds(50,270,100,25); 64 | 65 | LImg1.setBounds(0,290,495,260); 66 | 67 | PPanel1.add(LBookingDetails); 68 | PPanel1.add(LFrom); 69 | PPanel1.add(CBFrom); 70 | PPanel1.add(LTo); 71 | PPanel1.add(CBTo); 72 | PPanel1.add(LBookingDate); 73 | PPanel1.add(TFBookingDate); 74 | PPanel1.add(LDate); 75 | PPanel1.add(LClass); 76 | PPanel1.add(CBClass); 77 | PPanel1.add(BFindFlight); 78 | PPanel1.add(LImg1); 79 | PPanel1.setBackground(Color.white); 80 | 81 | c.add(PPanel1,BorderLayout.WEST); 82 | 83 | PPanel2 = new JPanel(null); 84 | PPanel2.setPreferredSize(new Dimension(320,160)); 85 | 86 | LPassengerDetails=new JLabel("PassengerDetails"); 87 | 88 | LAdult = new JLabel("Adults(12+)"); 89 | 90 | LChildren = new JLabel("Children(2-11)"); 91 | LInfant = new JLabel("Infants(under 2)"); 92 | 93 | String[] item4={"1","2","3","4","5","6"}; 94 | CBAdult = new JComboBox(item4); 95 | 96 | String[] item5={"0","1","2","3","4"}; 97 | CBChildren = new JComboBox(item5); 98 | 99 | String[] item6={"0","1","2","3"}; 100 | CBInfant = new JComboBox(item6); 101 | 102 | img2 = new ImageIcon("note_bg.gif"); 103 | LImg2 = new JLabel(img2); 104 | LNotes = new JLabel("

NOTE: Bookings with International Credit Cards

have temporarily been suspended.This Service

will resume shortly and we will have a notice

posted on our website.We regret any

inconvenience caused to our passengers."); 105 | 106 | LPassengerDetails.setBounds(40,3,100,20); 107 | 108 | LAdult.setBounds(40,40,100,20); 109 | CBAdult.setBounds(140,40,100,20); 110 | 111 | LChildren.setBounds(40,105,100,20); 112 | CBChildren.setBounds(140,105,100,20); 113 | 114 | LInfant.setBounds(40,170,100,20); 115 | CBInfant.setBounds(140,170,100,20); 116 | 117 | LImg2.setBounds(16,220,320,200); 118 | LNotes.setBounds(55,240,380,180); 119 | 120 | PPanel2.add(LPassengerDetails); 121 | PPanel2.add(LAdult); 122 | PPanel2.add(LChildren); 123 | PPanel2.add(LInfant); 124 | PPanel2.add(CBAdult); 125 | PPanel2.add(CBChildren); 126 | PPanel2.add(CBInfant); 127 | 128 | PPanel2.add(LNotes); 129 | PPanel2.add(LImg2); 130 | 131 | PPanel2.setBackground(Color.white); 132 | 133 | c.add(PPanel2,BorderLayout.EAST); 134 | 135 | setSize(795,580); 136 | setVisible(true); 137 | 138 | BFindFlight.addActionListener(new button2(this, type1)); 139 | } 140 | public static void main(String args[]) 141 | { 142 | LoginPage type1=null; 143 | new InternationalFlight(type1); 144 | } 145 | } 146 | 147 | class button2 implements ActionListener 148 | { 149 | InternationalFlight type; 150 | LoginPage type1; 151 | button2(InternationalFlight type, LoginPage type1) 152 | { 153 | this.type = type; 154 | this.type1 = type1; 155 | } 156 | public void actionPerformed(ActionEvent e) 157 | { 158 | String sFrom = (String)type.CBFrom.getSelectedItem(); 159 | String sTo = (String)type.CBTo.getSelectedItem(); 160 | String sClass = (String)type.CBClass.getSelectedItem(); 161 | String sBookingDate = type.TFBookingDate.getText(); 162 | Integer iPrice=0; 163 | String sTime=""; 164 | 165 | 166 | Integer iAdult = Integer.parseInt((String)type.CBAdult.getSelectedItem()); 167 | Integer iChildren = Integer.parseInt((String)type.CBChildren.getSelectedItem()); 168 | Integer iInfant = Integer.parseInt((String)type.CBInfant.getSelectedItem()); 169 | 170 | int i = 0; 171 | 172 | if(sClass.equals("Economic")) 173 | { 174 | try{ 175 | while(i<20) 176 | { 177 | if(type1.row2[i][1].equals(sTo)) 178 | { 179 | iPrice = Integer.parseInt((String)type1.row2[i][2]); 180 | sTime = (String)type1.row2[i][3]; 181 | break; 182 | } 183 | i++; 184 | } 185 | }catch(Exception e1) 186 | { 187 | JOptionPane.showMessageDialog(null, "You have no rights to access"); 188 | System.exit(0); 189 | } 190 | } 191 | else 192 | { 193 | try 194 | { 195 | while(i<20) 196 | { 197 | if(type1.row2[i][1].equals(sTo)) 198 | { 199 | iPrice = Integer.parseInt((String)type1.row4[i][2]); 200 | sTime = (String)type1.row4[i][3]; 201 | break; 202 | } 203 | i++; 204 | } 205 | }catch(Exception e1) 206 | { 207 | JOptionPane.showMessageDialog(null, "You have no rights to access it"); 208 | System.exit(0); 209 | } 210 | } 211 | type.setTitle(iPrice + " " + sTime); 212 | 213 | iPrice = (iPrice*iAdult)+(iPrice*(iChildren/2)); 214 | 215 | int iCount=0; 216 | int iSeatCount=0; 217 | 218 | String[] sTempFrom=new String[1250]; 219 | String[] sTempTo=new String[1250]; 220 | String[] sTempClass=new String[1250]; 221 | String[] sTempBookingDate=new String[1250]; 222 | String[] sTempTime=new String[1250]; 223 | Integer[] iTempAdult=new Integer[1250]; 224 | Integer[] iTempChildren=new Integer[1250]; 225 | Integer[] iTempInfant=new Integer[1250]; 226 | Integer[] iTempPrice=new Integer[1250]; 227 | 228 | try 229 | { 230 | //read from data 231 | Save1 save1; 232 | ObjectInputStream OIS1 = new ObjectInputStream(new FileInputStream("save1")); 233 | do 234 | { 235 | save1 = (Save1)OIS1.readObject(); 236 | sTempFrom[iCount] = save1.sFrom; 237 | sTempTo[iCount] = save1.sTo; 238 | sTempClass[iCount] = save1.sClass; 239 | sTempBookingDate[iCount] = save1.sBookingDate; 240 | sTempTime[iCount] = save1.sTime; 241 | iTempAdult[iCount] = save1.iAdult; 242 | iTempChildren[iCount] = save1.iChildren; 243 | iTempInfant[iCount] = save1.iInfant; 244 | iTempPrice[iCount] = save1.iPrice; 245 | 246 | iCount++; 247 | if(save1.sBookingDate.equals(sBookingDate)) 248 | if(save1.sTo.equals(sTo)) 249 | iSeatCount=iSeatCount + save1.iAdult + save1.iChildren + save1.iInfant; 250 | }while(save1!=null); 251 | OIS1.close(); 252 | 253 | } 254 | catch(Exception e1) 255 | { 256 | } 257 | 258 | iSeatCount = iSeatCount + iAdult + iChildren + iInfant; 259 | 260 | if(iSeatCount > 60) 261 | { 262 | JOptionPane.showMessageDialog(null,"Seats are full. Sorry!"); 263 | } 264 | else 265 | { 266 | int iChoice = JOptionPane.showConfirmDialog(null,"Seats available. Do you want to Book now?"); 267 | if(iChoice == JOptionPane.YES_OPTION) 268 | { 269 | new PrintTicket1(sFrom, sTo, sClass, iAdult, iChildren, iInfant, sBookingDate, iPrice, sTime); 270 | try 271 | { 272 | //write into data 273 | Save1 save2=new Save1(sFrom, sTo, sClass, iAdult, iChildren, iInfant, sBookingDate, iPrice, sTime); 274 | ObjectOutputStream OOS1 = new ObjectOutputStream(new FileOutputStream("save1")); 275 | for(i=0;iDomestic Flights"); 17 | JLabel LInternationalFlight = new JLabel("International Flights"); 18 | 19 | JLabel LUserName, LPassword; 20 | 21 | JLabel LDomesticFlight1 = new JLabel("Domestic Flight Booking"); 22 | JLabel LInternationalFlight1 = new JLabel("International Flight Booking"); 23 | 24 | JTextField TFUserName; 25 | JPasswordField TPPassword; 26 | 27 | JButton BLogin; 28 | 29 | final Object[] col1 ={ "From", "To", "Price", "Time" }; 30 | final Object[] col2 = { "From", "To", "Price", "Time" }; 31 | final Object[] col3 = { "From", "To", "Price", "Time" }; 32 | 33 | 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" } }; 34 | 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 " } }; 35 | 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" }, { "Trivandrum", "Lucknow", "9075", "05:30" }, { "Trivandrum", "Mumbai", "5175", "12:00" }, { "Trivandrum", "Vishakapatnam", "11175", "19:00" } }; 36 | 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" } }; 37 | 38 | JTable TDomesticFlight = new JTable(row1, col1); 39 | JTable TInternationalFlight = new JTable(row2, col2); 40 | JTable TDomesticFlight1 = new JTable(row3, col3); 41 | JTable TInternationalFlight1 = new JTable(row4, col2); 42 | 43 | JScrollPane JSP1 = new JScrollPane(TDomesticFlight, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); 44 | JScrollPane JSP2 = new JScrollPane(TInternationalFlight, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); 45 | JScrollPane JSP3 = new JScrollPane(TDomesticFlight1, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); 46 | JScrollPane JSP4 = new JScrollPane(TInternationalFlight1, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); 47 | 48 | Icon img1 = new ImageIcon("img/economic.jpg"); 49 | Icon img2 = new ImageIcon("img/business.jpg"); 50 | Icon img3 = new ImageIcon("img/economic1.jpg"); 51 | Icon img4 = new ImageIcon("img/business1.jpg"); 52 | 53 | JLabel LEconomic = new JLabel("Economic", img1, SwingConstants.LEFT); 54 | JLabel LBusiness = new JLabel("Business", img2, SwingConstants.LEFT); 55 | JLabel LEconomic1 = new JLabel("Economic", img3, SwingConstants.LEFT); 56 | JLabel LBusiness1 = new JLabel("Business", img4, SwingConstants.LEFT); 57 | 58 | public LoginPage() 59 | { 60 | WindowUtilities.setNativeLookAndFeel(); 61 | setPreferredSize(new Dimension(796,572)); 62 | 63 | PFlightTypes.setBackground(Color.white); 64 | PLogin.setBackground(Color.white); 65 | PFlightDetails.setBackground(Color.white); 66 | 67 | JSP1.setBounds(0, 340, 790, 200); 68 | JSP2.setBounds(0, 340, 790, 200); 69 | JSP3.setBounds(0, 340, 790, 200); 70 | JSP4.setBounds(0, 340, 790, 200); 71 | 72 | PFlightTypes.setBounds(0,0,500, 340); 73 | PLogin.setBounds(500,0,350, 340); 74 | PFlightDetails.setBounds(0,340,790,200); 75 | 76 | 77 | LUserName = new JLabel(" User Name "); 78 | LPassword = new JLabel(" Password "); 79 | TFUserName = new JTextField(10); 80 | TPPassword = new JPasswordField(10); 81 | BLogin = new JButton("Sign In"); 82 | 83 | LUserName.setBounds(40, 100, 100, 21); 84 | LPassword.setBounds(40, 140, 100, 21); 85 | TFUserName.setBounds(160, 100, 100, 21); 86 | TPPassword.setBounds(160, 140, 100, 21); 87 | BLogin.setBounds(160, 200, 100,25); 88 | 89 | LDomesticFlight1.setBounds(60, 60, 138, 20); 90 | LInternationalFlight1.setBounds(60, 100, 153, 20); 91 | 92 | PLogin.add(LUserName); 93 | PLogin.add(TFUserName); 94 | PLogin.add(LPassword); 95 | PLogin.add(TPPassword); 96 | PLogin.add(BLogin); 97 | 98 | PFlightDetails.add(JSP1); 99 | PFlightDetails.add(JSP2); 100 | PFlightDetails.add(JSP3); 101 | PFlightDetails.add(JSP4); 102 | 103 | JSP1.setVisible(true); 104 | JSP2.setVisible(false); 105 | JSP3.setVisible(false); 106 | JSP4.setVisible(false); 107 | 108 | LBusiness.setBounds(265, 170, 300, 125); 109 | LEconomic.setBounds(0, 170, 250, 125); 110 | LBusiness1.setBounds(280, 200, 135, 60); 111 | LEconomic1.setBounds(50, 200, 147, 60); 112 | 113 | PFlightTypes.add(LEconomic); 114 | PFlightTypes.add(LBusiness); 115 | PFlightTypes.add(LEconomic1); 116 | PFlightTypes.add(LBusiness1); 117 | 118 | LBusiness.setVisible(false); 119 | LEconomic1.setVisible(false); 120 | LBusiness1.setVisible(true); 121 | LEconomic.setVisible(true); 122 | 123 | 124 | LDomesticFlight.setBounds(60, 60, 100, 25); 125 | LInternationalFlight.setBounds(60, 100, 120, 25); 126 | 127 | c.add(PFlightTypes); 128 | c.add(PLogin); 129 | c.add(PFlightDetails); 130 | 131 | PFlightTypes.add(LDomesticFlight); 132 | PFlightTypes.add(LInternationalFlight); 133 | 134 | pack(); 135 | setVisible(true); 136 | 137 | addWindowListener(new ExitListener()); 138 | 139 | LDomesticFlight.addMouseListener(new mouse1(this, true)); 140 | LInternationalFlight.addMouseListener(new mouse1(this, false)); 141 | 142 | LDomesticFlight1.addMouseListener(new mouse3(this, true)); 143 | LInternationalFlight1.addMouseListener(new mouse3(this, false)); 144 | 145 | LBusiness1.addMouseListener(new mouse2(this, true)); 146 | LEconomic1.addMouseListener(new mouse2(this, false)); 147 | 148 | BLogin.addActionListener(new button1(this)); 149 | } 150 | 151 | public static void main(String args[]) 152 | { 153 | new LoginPage(); 154 | } 155 | } 156 | 157 | 158 | class button1 implements ActionListener 159 | { 160 | LoginPage type; 161 | char[] cCheck, cPassword={'a','d','m','i','n','\0'}; 162 | JFrame f; 163 | String sCheck,sCheck1="admin"; 164 | 165 | public button1(LoginPage type) 166 | { 167 | this.type = type; 168 | } 169 | public void actionPerformed(ActionEvent e) 170 | { 171 | cCheck=type.TPPassword.getPassword(); 172 | sCheck = type.TFUserName.getText(); 173 | if ((sCheck1.equals(sCheck)) && check()) 174 | { 175 | type.PLogin.add(type.LDomesticFlight1); 176 | type.PLogin.add(type.LInternationalFlight1); 177 | 178 | type.PLogin.remove(type.LUserName); 179 | type.PLogin.remove(type.TFUserName); 180 | type.PLogin.remove(type.LPassword); 181 | type.PLogin.remove(type.TPPassword); 182 | type.PLogin.remove(type.BLogin); 183 | 184 | type.c.repaint(); 185 | } 186 | else 187 | { 188 | JOptionPane.showMessageDialog(null, "Invalid username or password. Try again"); 189 | } 190 | } 191 | public boolean check() 192 | { 193 | if (cCheck.length >= 6 || cCheck.length < 4) 194 | return false; 195 | for(int i=0;i<=4;i++) 196 | { 197 | if(cCheck[i]!=cPassword[i]) 198 | return false; 199 | } 200 | return true; 201 | } 202 | } 203 | 204 | class mouse1 extends MouseAdapter 205 | { 206 | LoginPage type; 207 | boolean bCheck; 208 | 209 | public mouse1(LoginPage type, boolean bCheck) 210 | { 211 | this.type = type; 212 | this.bCheck = bCheck; 213 | } 214 | public void mouseEntered(MouseEvent e) 215 | { 216 | type.LDomesticFlight.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); 217 | type.LInternationalFlight.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); 218 | } 219 | public void mouseClicked(MouseEvent e) 220 | { 221 | if(bCheck) 222 | type.bCheck = true; 223 | else 224 | type.bCheck = false; 225 | type.LEconomic.setVisible(true); 226 | type.LBusiness1.setVisible(true); 227 | type.LEconomic1.setVisible(false); 228 | type.LBusiness.setVisible(false); 229 | 230 | type.JSP1.setVisible(false); 231 | type.JSP2.setVisible(false); 232 | type.JSP3.setVisible(false); 233 | type.JSP4.setVisible(false); 234 | if(bCheck) 235 | type.JSP1.setVisible(true); 236 | else 237 | type.JSP2.setVisible(true); 238 | } 239 | } 240 | 241 | 242 | 243 | class mouse3 extends MouseAdapter 244 | { 245 | LoginPage type; 246 | boolean bCheck; 247 | 248 | public mouse3(LoginPage type, boolean bCheck) 249 | { 250 | this.type = type; 251 | this.bCheck = bCheck; 252 | } 253 | public void mouseEntered(MouseEvent e) 254 | { 255 | type.LDomesticFlight1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); 256 | type.LInternationalFlight1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); 257 | } 258 | public void mouseClicked(MouseEvent e) 259 | { 260 | if (bCheck) 261 | new DomesticFlight(type); 262 | else 263 | new InternationalFlight(type); 264 | } 265 | } 266 | 267 | 268 | class mouse2 extends MouseAdapter 269 | { 270 | LoginPage type; 271 | boolean bCheck; 272 | 273 | public mouse2(LoginPage type, boolean bCheck) 274 | { 275 | this.type = type; 276 | this.bCheck = bCheck; 277 | } 278 | public void mouseEntered(MouseEvent e) 279 | { 280 | type.LEconomic1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); 281 | type.LBusiness1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); 282 | } 283 | public void mouseClicked(MouseEvent e) 284 | { 285 | if(type.bCheck) 286 | { 287 | if (bCheck) 288 | { 289 | type.LBusiness1.setVisible(false); 290 | type.LBusiness.setVisible(true); 291 | type.LEconomic.setVisible(false); 292 | type.LEconomic1.setVisible(true); 293 | type.JSP1.setVisible(false); 294 | type.JSP2.setVisible(false); 295 | type.JSP3.setVisible(true); 296 | type.JSP4.setVisible(false); 297 | } 298 | else 299 | { 300 | type.LEconomic1.setVisible(false); 301 | type.LBusiness.setVisible(false); 302 | type.LBusiness1.setVisible(true); 303 | type.LEconomic.setVisible(true); 304 | type.JSP1.setVisible(true); 305 | type.JSP2.setVisible(false); 306 | type.JSP3.setVisible(true); 307 | type.JSP4.setVisible(false); 308 | } 309 | } 310 | else 311 | { 312 | if (bCheck) 313 | { 314 | type.LBusiness1.setVisible(false); 315 | type.LBusiness.setVisible(true); 316 | type.LEconomic.setVisible(false); 317 | type.LEconomic1.setVisible(true); 318 | type.JSP1.setVisible(false); 319 | type.JSP2.setVisible(false); 320 | type.JSP3.setVisible(false); 321 | type.JSP4.setVisible(true); 322 | } 323 | else 324 | { 325 | type.LEconomic1.setVisible(false); 326 | type.LBusiness.setVisible(false); 327 | type.LBusiness1.setVisible(true); 328 | type.LEconomic.setVisible(true); 329 | type.JSP1.setVisible(false); 330 | type.JSP2.setVisible(true); 331 | type.JSP3.setVisible(false); 332 | type.JSP4.setVisible(false); 333 | } 334 | } 335 | } 336 | } 337 | 338 | -------------------------------------------------------------------------------- /PrintTicket1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/PrintTicket1.class -------------------------------------------------------------------------------- /PrintTicket1.java: -------------------------------------------------------------------------------- 1 | import javax.swing.*; 2 | import java.awt.*; 3 | import java.awt.event.*; 4 | 5 | public class PrintTicket1 extends JFrame 6 | { 7 | public PrintTicket1(String sFrom, String sTo, String sClass, Integer iAdult, Integer iChildren, Integer iInfant, String sBookingDate, Integer iPrice, String sTime) 8 | { 9 | Container c=getContentPane(); 10 | c.setLayout(new BorderLayout()); 11 | 12 | 13 | JPanel Panel2 = new JPanel(null); 14 | 15 | Panel2.setPreferredSize(new Dimension(500,200)); 16 | 17 | JLabel LTitle = new JLabel("AirLine Ticket"); 18 | JLabel LFrom = new JLabel("From                          :  "+ sFrom+"" ); 19 | JLabel LTo = new JLabel("To                                :  "+sTo+""); 20 | JLabel LClass = new JLabel("Class                          :  "+sClass+"" ); 21 | JLabel LBookingDate = new JLabel("Traveling Date          : "+ sBookingDate+"" ); 22 | JLabel LPrice = new JLabel("Total Price                 : "+ iPrice+"" ); 23 | JLabel LTime = new JLabel("DepatureTime          : "+ sTime+"" ); 24 | JLabel LAdult = new JLabel("Adult                           :  "+iAdult+"" ); 25 | JLabel LChildren = new JLabel("Children                     :  "+ iChildren+"" ); 26 | JLabel LInfant = new JLabel("Infant                          :  "+iInfant+"" ); 27 | JLabel LWishes = new JLabel("Wish you a happy journy"); 28 | 29 | 30 | JLabel LTicketNo=new JLabel("TicketNumber          :  "); 31 | JLabel LBookedBy=new JLabel("BookedBy                  :  "); 32 | 33 | JLabel LEmpty = new JLabel("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------"); 34 | JLabel LDemo = new JLabel("AirLine-Project Developed By"); 35 | JLabel LFranklin=new JLabel("R Franklin Bourgia Singh"); 36 | JLabel LRavi=new JLabel("V.R Ravi Sankar"); 37 | JLabel LMayuran=new JLabel("B Mayuran"); 38 | JLabel LSathya=new JLabel("Sathyaraj"); 39 | 40 | 41 | LTitle.setBounds(170,15,500,45); 42 | LFrom.setBounds(20,80,300,20); 43 | 44 | LTo.setBounds(20,125,300,20); 45 | LClass.setBounds(20,170,300,20); 46 | LBookingDate.setBounds(20,215,300,20); 47 | LPrice.setBounds(20,260,300,20); 48 | LTime.setBounds(20,305,300,20); 49 | LAdult.setBounds(20,345,300,20); 50 | LChildren.setBounds(20,385,300,20); 51 | LInfant.setBounds(20,430,300,20); 52 | 53 | LWishes.setBounds(530,435,300,20); 54 | 55 | 56 | LTicketNo.setBounds(320,80,300,20); 57 | LBookedBy.setBounds(320,125,300,20); 58 | 59 | LEmpty.setBounds(3,445,1000,20); 60 | 61 | LDemo.setBounds(280,465,300,20); 62 | LFranklin.setBounds(285,485,300,20); 63 | LRavi.setBounds(285,505,300,20); 64 | LMayuran.setBounds(285,525,300,20); 65 | LSathya.setBounds(285,545,300,20); 66 | 67 | 68 | Panel2.add(LTitle); 69 | Panel2.add(LFrom); 70 | Panel2.add(LTo); 71 | Panel2.add(LClass); 72 | Panel2.add(LBookingDate); 73 | Panel2.add(LAdult); 74 | Panel2.add(LChildren); 75 | Panel2.add(LInfant); 76 | Panel2.add(LPrice); 77 | Panel2.add(LTime); 78 | //Panel2.add(LEmpty); 79 | 80 | Panel2.add(LWishes); 81 | 82 | Panel2.add(LTicketNo); 83 | Panel2.add(LBookedBy); 84 | Panel2.add(LEmpty); 85 | Panel2.add(LDemo); 86 | 87 | 88 | Panel2.add(Yugesh Verma); 89 | Panel2.add(gopi pal); 90 | Panel2.add(neeraj); 91 | Panel2.add(sunil); 92 | 93 | 94 | Panel2.setBackground(Color.white); 95 | 96 | c.add(Panel2, BorderLayout.CENTER); 97 | 98 | 99 | //pack(); 100 | setSize(700,650); 101 | setVisible(true); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Airline-reservation-system-java 2 | -------------------------------------------------------------------------------- /Save1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/Save1.class -------------------------------------------------------------------------------- /Save2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/Save2.class -------------------------------------------------------------------------------- /WindowUtilities.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/WindowUtilities.class -------------------------------------------------------------------------------- /WindowUtilities.java: -------------------------------------------------------------------------------- 1 | import javax.swing.*; 2 | import java.awt.*; 3 | 4 | public class WindowUtilities 5 | { 6 | public static void setNativeLookAndFeel() 7 | { 8 | try 9 | { 10 | UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 11 | }catch(Exception e) 12 | { 13 | System.out.println("Error setting native LAF: " + e); 14 | } 15 | } 16 | //UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); 17 | //UIManager.setLookAndFeel( "com.sun.java.swing.plaf.motif.MotifLookAndFeel"); 18 | } -------------------------------------------------------------------------------- /airline project.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/airline project.pdf -------------------------------------------------------------------------------- /button1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/button1.class -------------------------------------------------------------------------------- /button2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/button2.class -------------------------------------------------------------------------------- /button3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/button3.class -------------------------------------------------------------------------------- /img/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/img/Thumbs.db -------------------------------------------------------------------------------- /img/business.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/img/business.jpg -------------------------------------------------------------------------------- /img/business1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/img/business1.JPG -------------------------------------------------------------------------------- /img/economic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/img/economic.jpg -------------------------------------------------------------------------------- /img/economic1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/img/economic1.JPG -------------------------------------------------------------------------------- /map1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/map1.jpg -------------------------------------------------------------------------------- /mouse1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/mouse1.class -------------------------------------------------------------------------------- /mouse2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/mouse2.class -------------------------------------------------------------------------------- /mouse3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/mouse3.class -------------------------------------------------------------------------------- /note_bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/note_bg.gif -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | Username: admin 2 | Password: admin -------------------------------------------------------------------------------- /save2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectworldsofficial/Airline-reservation-system-java/afe805b5d685a319eefe2e79d9a7327f5e624a0c/save2 --------------------------------------------------------------------------------