-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReceipt.java
More file actions
69 lines (57 loc) · 1.84 KB
/
Receipt.java
File metadata and controls
69 lines (57 loc) · 1.84 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
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
public class Receipt {
private HotelReservationSystem s;
public Receipt(HotelReservationSystem s, ArrayList<Reservation> reservations)
{
this.s = s;
//Create two buttons
JFrame frame = new JFrame();
JButton signup = new JButton("Simple Receipt");
JButton signin = new JButton("Comprehensive Receipt");
JPanel panel = new JPanel();
panel.setBackground(new Color(136, 189, 188));
panel.setLayout(new BorderLayout());
/*signup.setBounds(100, 50, 500, 150);
signin.setBounds(100, 250, 500, 150);*/
JLabel label = new JLabel("Welcome Guest!");
label.setFont(new Font("Impact", Font.PLAIN, 40));
label.setForeground(Color.WHITE);
label.setHorizontalAlignment(SwingConstants.CENTER);
panel.add(label, BorderLayout.CENTER);
JPanel buttonPanel = new JPanel();
buttonPanel.setBackground(new Color(136, 189, 188));
buttonPanel.add(signup);
buttonPanel.add(signin);
panel.add(buttonPanel, BorderLayout.SOUTH);
frame.add(panel);
frame.setSize(new Dimension(500,500));
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
signup.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
frame.dispose();
new HomeScreen(s);
new SimpleReceiptGUI(reservations);
}
});
signin.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
frame.dispose();
new HomeScreen(s);
new ComprehensiveReceiptGUI(s.getCurrentGuest().getReservations());
}
});
}
}