-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHome.java
More file actions
79 lines (60 loc) · 2.5 KB
/
Home.java
File metadata and controls
79 lines (60 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package airlinemanagementsystem;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Home extends JFrame implements ActionListener{
public Home() {
setLayout(null);
ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("airlinemanagementsystem/icons/front.jpg"));
JLabel image = new JLabel(i1);
image.setBounds(0, 0, 1600, 800);
add(image);
JLabel heading = new JLabel("AIR INDIA WELCOMES YOU");
heading.setBounds(500, 40, 1000, 40);
heading.setForeground(Color.BLUE);
heading.setFont(new Font("Tahoma", Font.PLAIN, 36));
image.add(heading);
JMenuBar menubar = new JMenuBar();
setJMenuBar(menubar);
JMenu details = new JMenu("Details");
menubar.add(details);
JMenuItem flightDetails = new JMenuItem("Flight Details");
flightDetails.addActionListener(this);
details.add(flightDetails);
JMenuItem customerDetails = new JMenuItem("Add Customer Details");
customerDetails.addActionListener(this);
details.add(customerDetails);
JMenuItem bookFlight = new JMenuItem("Book Flight");
bookFlight.addActionListener(this);
details.add(bookFlight);
JMenuItem journeyDetails = new JMenuItem("Journey Details");
journeyDetails.addActionListener(this);
details.add(journeyDetails);
JMenuItem ticketCancellation = new JMenuItem("Cancel Ticket");
ticketCancellation.addActionListener(this);
details.add(ticketCancellation);
JMenu ticket = new JMenu("Ticket");
menubar.add(ticket);
JMenuItem boardingPass = new JMenuItem("Boarding Pass");
ticket.add(boardingPass);
setExtendedState(JFrame.MAXIMIZED_BOTH);
setVisible(true);
}
public void actionPerformed(ActionEvent ae) {
String text = ae.getActionCommand();
if (text.equals("Add Customer Details")) {
new AddCustomer();
} else if (text.equals("Flight Details")) {
new FlightInfo();
} else if (text.equals("Book Flight")) {
new BookFlight();
} else if (text.equals("Journey Details")) {
new JourneyDetails();
} else if (text.equals("Cancel Ticket")) {
new Cancel();
}
}
public static void main(String[] args) {
new Home();
}
}