-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProduct
More file actions
47 lines (39 loc) · 1.06 KB
/
Product
File metadata and controls
47 lines (39 loc) · 1.06 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
package GUI;
import java.awt.Container;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class Product {
JFrame f = new JFrame("Product");
JLabel lbID = new JLabel("Product Id");
JTextField tfID = new JTextField(10);
JLabel lbName = new JLabel("Product Name");
JTextField tfName = new JTextField(10);
JLabel lbQuantity = new JLabel("Quantity");
JTextField tfQuantity = new JTextField(10);
JButton btnAdd = new JButton("Add");
JButton btnUpdate = new JButton("Edit");
JButton btnDelete = new JButton("Delete");
public Product() {
f.setLocation(250,250);
f.setLayout(new GridLayout(7,2));
Container cont = f.getContentPane();
cont.add(lbID);
cont.add(tfID);
cont.add(lbName);
cont.add(tfName);
cont.add(lbQuantity);
cont.add(tfQuantity);
cont.add(btnAdd);
cont.add(btnUpdate);
f.pack();
f.setSize(500,500);
f.setVisible(true);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new Product();
}
}