-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLayoutMix.java
More file actions
64 lines (41 loc) · 1.19 KB
/
LayoutMix.java
File metadata and controls
64 lines (41 loc) · 1.19 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
package helloswing;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class LayoutMix extends JFrame{
JPanel p1 = new JPanel();
JPanel p2 = new JPanel();
JPanel p3 = new JPanel();
JButton btn1 = new JButton("버튼1");
JButton btn2 = new JButton("버튼2");
JButton btn3 = new JButton("버튼3");
JButton btn4 = new JButton("버튼4");
JButton btn5 = new JButton("버튼5");
JButton btn6 = new JButton("버튼6");
LayoutMix(){
setLayout(new BorderLayout());
p1.setLayout(new FlowLayout());
p2.setLayout(new GridLayout(0,2));
p3.setLayout(new FlowLayout());
p1.add(btn1);
p1.add(btn2);
p2.add(btn3);
p2.add(btn4);
p3.add(btn5);
p3.add(btn6);
add(p1, BorderLayout.NORTH);
add(p2, BorderLayout.CENTER);
add(p3, BorderLayout.SOUTH);
setTitle("레이아웃섞기");
setSize(400, 300);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setLocationRelativeTo(null);
setVisible(true);
}
public static void main(String[] args) {
new LayoutMix();
}
}