-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReservationGUI.java
More file actions
43 lines (36 loc) · 1.09 KB
/
ReservationGUI.java
File metadata and controls
43 lines (36 loc) · 1.09 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
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class ReservationGUI {
private HotelReservationSystem s;
public ReservationGUI(HotelReservationSystem s)
{
this.s = s;
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setTitle("Reservation");
JPanel buttonPanel = new JPanel();
buttonPanel.setBackground(new Color(136, 189, 188));
JButton mButton = new JButton("Make a reservation");
JButton vButton = new JButton("View reservations");
buttonPanel.add(mButton);
buttonPanel.add(vButton);
mButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
new ReservationMake(s);
}
});
vButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
new ViewReservation(s);
}
});
frame.add(buttonPanel, BorderLayout.CENTER);
frame.setSize(500, 500);
frame.setVisible(true);
}
}