-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGuiClient.java
More file actions
83 lines (70 loc) · 2.2 KB
/
GuiClient.java
File metadata and controls
83 lines (70 loc) · 2.2 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
package NewDB;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class GuiClient {
private JFrame frame;
GuiClient gui;
public GuiClient() {
gui = this;
}
void setVisible(boolean visiable) {
frame.setVisible(visiable);
}
void initialize() {
frame = new JFrame();
frame.setTitle("Client");
frame.setBounds(0, 0, 1300, 800);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
JLabel Label = new JLabel("options:");
Label.setBounds(600, 70, 200, 50);
frame.getContentPane().add(Label);
JButton Return = new JButton("return"); //上一頁
Return.setBounds(20, 50, 100, 30);
frame.getContentPane().add(Return);
Return.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
GuiFrontPage gui = new GuiFrontPage();
gui.initialize();
gui.setVisible(true);
frame.dispose();
}
});
// JButton btn1 = new JButton("Add a package"); //新增包裹
// btn1.setBounds(600, 120, 120, 50);
// frame.getContentPane().add(btn1);
JButton btn2 = new JButton("Order summary"); //查詢訂單狀況
btn2.setBounds(600, 180, 120, 50);
frame.getContentPane().add(btn2);
JButton btn3 = new JButton("Meter pricing"); //價格試算
btn3.setBounds(600, 240, 120, 50);
frame.getContentPane().add(btn3);
// btn1.addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// GuiAddPackage gui = new GuiAddPackage();
// gui.initialize();
// gui.setVisible(true);
// frame.dispose();
// }
// });
btn2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
GuiOrderSummary gui = new GuiOrderSummary();
gui.initialize();
gui.setVisible(true);
frame.dispose();
}
});
btn3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
GuiMeterPricing gui = new GuiMeterPricing();
gui.initialize();
gui.setVisible(true);
frame.dispose();
}
});
}
}