-
Notifications
You must be signed in to change notification settings - Fork 0
/
ResultPage.java
76 lines (65 loc) · 2.11 KB
/
ResultPage.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
70
71
72
73
74
75
76
package java_gui;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class ResultPage extends PagePanel {
JLabel countPrint;
JLabel namePrint;
JLabel seatPrint;
public ResultPage(Frame f, Field field) {
this.field = field;
Color b=new Color(27, 60, 53);
setBackground(b);
setSize(800, 600);
setLayout(null);
Frame F = f;
Font f1 = new Font("고딕", Font.BOLD, 40);
Font f2 = new Font("고딕", Font.BOLD, 30);
countPrint = new JLabel("영수증");
countPrint.setForeground(Color.white);
countPrint.setFont(f1);
namePrint = new JLabel(field.getName()+"님의 정보입니다");
namePrint.setForeground(Color.white);
namePrint.setFont(f2);
seatPrint = new JLabel("좌석"+field.getSeat());
seatPrint.setForeground(Color.white);
seatPrint.setFont(f2);
countPrint.setBounds(300, 70, 500, 60);
namePrint.setBounds(200, 160, 500, 40);
seatPrint.setBounds(290, 210, 500, 40);
add(countPrint);
add(namePrint);
add(seatPrint);
JButton nextBtn = new JButton(new ImageIcon("./Button_Images/endBtn.PNG")); // 홈으로 돌아가기
nextBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
// 홈으로 돌아가기
new HomePage(F, field);
setVisible(false);
F.InitFrame(field);
F.updatePage();
// info(유저정보 리스트)에 키와 이름, 좌석, 메뉴 넣기
field.addUser(field.getPhone());
// 한 사이클이 종료되었으니 정보입력란 모두 리셋
field.setName("");
field.setPhone("");
field.setSeat(0);
field.increaseCount();
}
});
nextBtn.setBounds(300, 450, 200, 100);
add(nextBtn);
setVisible(true);
}
public void updatePage(){
countPrint.setText("주문번호 ["+field.getCount()+"]");
namePrint.setText(field.getName()+" 고객님의 좌석 정보입니다.");
seatPrint.setText("이용 좌석 : " + String.valueOf(field.getSeat()));
this.updateUI();
}
}