forked from sanjana091001/bus_booking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interfacedes.java
69 lines (65 loc) · 1.84 KB
/
interfacedes.java
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
package bus_booking;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class interfacedes extends JFrame implements ActionListener{
JButton userbtn, bookingbtn, busbtn, bus_standbtn, loginbtn, exitbtn;
interfacedes(){
setTitle("Bus Booking System");
getContentPane().setBackground(Color.white);
setBackground(Color.CYAN);
getContentPane().setForeground(Color.white);
getContentPane().setLayout(new FlowLayout());
JLabel label = new JLabel("Bus Booking System");
label.setFont(new Font("SANS_SERIF", Font.BOLD, 20));
label.setForeground(Color.BLACK);
getContentPane().add(label);
setBounds(400, 200, 400, 400);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
userbtn = new JButton("User");
bookingbtn = new JButton("Booking");
busbtn = new JButton("Bus Details");
bus_standbtn = new JButton("Bus Stand Details");
loginbtn = new JButton("Login");
exitbtn = new JButton("Exit");
userbtn.addActionListener(this);
bookingbtn.addActionListener(this);
busbtn.addActionListener(this);
bus_standbtn.addActionListener(this);
loginbtn.addActionListener(this);
exitbtn.addActionListener(this);
add(userbtn);
add(bookingbtn);
add(busbtn);
add(bus_standbtn);
add(loginbtn);
add(exitbtn);
setVisible(true);
}
public void actionPerformed(ActionEvent ae) {
if (ae.getSource() == userbtn) {
new userbtn();
repaint();
}
else if (ae.getSource() == bookingbtn) {
new bookingbtn();
repaint();
}
else if (ae.getSource() == busbtn) {
new busbtn();
repaint();
}
else if (ae.getSource() == bus_standbtn) {
new bus_standbtn();
repaint();
}
else if (ae.getSource() == loginbtn) {
new loginbtn();
repaint();
}
else if (ae.getSource() == exitbtn) {
new exitbtn();
repaint();
}
}
}