-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHomePage1.java
More file actions
116 lines (94 loc) · 2.57 KB
/
HomePage1.java
File metadata and controls
116 lines (94 loc) · 2.57 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
package railwayreservation;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import java.awt.Color;
import java.awt.Font;
import javax.swing.JButton;
public class HomePage1 extends JDialog implements ActionListener{
JButton login,exit,passenger,reservation,cancellation,pnrenq;
public HomePage1() {
getContentPane().setLayout(null);
getContentPane().setBackground(Color.pink);
JLabel lblNewLabel = new JLabel("RAILWAY RESERVATION");
lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 34));
lblNewLabel.setBounds(208, 119, 450, 86);
getContentPane().add(lblNewLabel);
login = new JButton("Login Page");
login.setMnemonic('l');
login.setBounds(208, 296, 115, 23);
getContentPane().add(login);
passenger = new JButton(" Passenger info Form");
passenger.setMnemonic('p');
passenger.setBounds(493, 296, 133, 23);
getContentPane().add(passenger);
reservation = new JButton("Reservation form");
reservation.setMnemonic('r');
reservation.setBounds(153, 437, 115, 23);
getContentPane().add(reservation);
cancellation = new JButton("Cancellation form");
cancellation.setMnemonic('c');
cancellation.setBounds(582, 437, 133, 23);
getContentPane().add(cancellation);
pnrenq = new JButton("PNR Enquiry");
pnrenq.setMnemonic('z');
pnrenq.setBounds(377, 437, 107, 23);
getContentPane().add(pnrenq);
exit = new JButton("Exit");
exit.setMnemonic('e');
exit.setBounds(381, 574, 103, 23);
getContentPane().add(exit);
login.addActionListener(this);
passenger.addActionListener(this);
cancellation.addActionListener(this);
reservation.addActionListener(this);
pnrenq.addActionListener(this);
exit.addActionListener(this);
setSize(900,700);
setVisible(true);
}
public static void main(String[] args) {
new HomePage1();
// TODO Auto-generated method stub
}
@Override
public void actionPerformed(ActionEvent e) {
Object ob=e.getSource();
if(ob==login)
{
new Loginform();
dispose();
}
else if(ob==passenger)
{
new Passenger();
dispose();
}
else if(ob==reservation)
{
new ReservationForm();
dispose();
}
else
if(ob==pnrenq)
{
new PNREnquiry();
dispose();
}
else if(ob==cancellation)
{
new Cancellationform();
dispose();
}else if(ob==exit)
{
int yn=JOptionPane.showConfirmDialog(null,"sure to Exit","Swings",JOptionPane.YES_NO_OPTION);
if(yn==0)
{
System.exit(0);
}
}
// TODO Auto-generated method stub
}
}