-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestCC.java
More file actions
36 lines (28 loc) · 817 Bytes
/
Copy pathtestCC.java
File metadata and controls
36 lines (28 loc) · 817 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
36
import javax.swing.*;
public class testCC extends JFrame {
JButton btn1 = new JButton("WestButton");
JButton btn2 = new JButton("CenterButton");
JPanel jpn = new JPanel();
JButton btn3 = new JButton("File");
JButton btn4 = new JButton("Help");
public testCC() {
// 레이아웃 변경
// JPanel에 컴포넌트 추가
jpn.add(btn3);
jpn.add(btn4);
// JFrame에 컴포넌트 추가
add(jpn, "North");
add(btn1, "West");
add(btn2, "Center");
// 크기
setSize(300, 200);
// super.pack();
// 보이기
setVisible(true);
// x : 종료
super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args) {
new testCC();
}
}