forked from Fuseken/code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPanelTest.java
More file actions
35 lines (25 loc) · 691 Bytes
/
PanelTest.java
File metadata and controls
35 lines (25 loc) · 691 Bytes
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
import javax.swing.*;
import java.awt.*;
public class PanelTest {
private JFrame f;
private JPanel p;
private JButton b1;
private JLabel lab;
public PanelTest() { gui(); }
public void gui() {
f = new JFrame("Creativity tuts");
f.setVisible(true);
f.setSize(600,400);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
p = new JPanel();
p.setBackground(Color.YELLOW);
b1 = new JButton("Test");
lab = new JLabel("This is test label");
p.add(b1);
p.add(lab);
f.add(p,BorderLayout.SOUTH);
}
public static void main(String[] args) {
new PanelTest();
}
}