-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.java
More file actions
102 lines (67 loc) · 2.09 KB
/
Button.java
File metadata and controls
102 lines (67 loc) · 2.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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import java.awt.Container;
import java.awt.EventQueue;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Button extends JFrame {
JButton button1, button2, button3, button4;
public Button(InventorySystem system)
{
initUI(system);
}
public void initUI(InventorySystem system){
setTitle("Orders Button");
setSize(300,200);
setLocationRelativeTo(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
createButtons();
button1.addActionListener( new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
AddItemButton addItem = new AddItemButton(system);
addItem.setVisible(true);
}
});
button2.addActionListener( new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
RemoveWindow removeItem = new RemoveWindow(system);
removeItem.setVisible(true);
//system.removeItem();
}
});
button3.addActionListener( new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
system.showOrders();
}
});
button4.addActionListener( new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
system.showPurchaseOrders();
}
});
Container container = this.getContentPane();
JPanel panel1 = new JPanel(new GridLayout(2,2));
panel1.add(button1);
panel1.add(button2);
panel1.add(button3);
panel1.add(button4);
container.add(panel1);
}
public void createButtons(){
button1 = new JButton("Add Item to Inventory");
button2 = new JButton("Remove Item from Inventory");
button3 = new JButton("View Customer Orders");
button4 = new JButton("View Purchase Orders");
}
}
cheeky