Repository navigation
Expand file tree
/
Copy pathJframe.java
More file actions
61 lines (46 loc) · 1.33 KB
/
Copy pathJframe.java
File metadata and controls
61 lines (46 loc) · 1.33 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
package TugasKuis;
import java.awt.Container;
import java.awt.FlowLayout;
import javax.swing.*;
public class Jframe extends JFrame{
private static final int LEBAR = 350;
private static final int TINGGI=200;
private static final int POS_X=150;
private static final int POS_Y=250;
ProductTable tb = new ProductTable();
private Jframe(String judul)
{
super(judul);
setSize(LEBAR,TINGGI);
setLocation(POS_X,POS_Y);
setDefaultCloseOperation(EXIT_ON_CLOSE);
JButton tombolCari = new JButton("Cari");
Container panel = getContentPane();
panel.setLayout(new FlowLayout());
//label Product ID
JLabel LIDProduct = new JLabel("ID Product");
panel.add(LIDProduct);
//txtBox ID
JTextField txtIDProduct = new JTextField(16);
panel.add(txtIDProduct);
//Button Cari
getContentPane().setLayout(new FlowLayout());
getContentPane().add(tombolCari);
//label Nama Product
JLabel LNama = new JLabel("Nama Product");
panel.add(LNama);
//txtBox Nama
JTextField txtNama = new JTextField(20);
panel.add(txtNama);
//label Nama Product
JLabel LHarga = new JLabel("Harga Product");
panel.add(LHarga);
//txtBox Nama
JTextField txtHarga = new JTextField(20);
panel.add(txtHarga);
}
public static void main(String[] args) {
Jframe frame = new Jframe("Cari Product");
frame.setVisible(true);
}
}