방치하기

홍대 자바 수업 : 핵심 플로우 그리드 보더 레이아웃 본문

홍익대 Java/수업

홍대 자바 수업 : 핵심 플로우 그리드 보더 레이아웃

Yi Junho 2009. 7. 28. 15:56
반응형
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
import java.awt.event.*;
import java.awt.*;
 
class Fram extends Frame {
    public Fram(){
    super("윈도우 이벤트");
    //setLayout(new FlowLayout()); 플로우 레이아웃
    //setLayout(new GridLayout(3,2));그리드 레이아웃
    setLayout(new BorderLayout());
    add(new Button("button 01"),"East");
    add(new Button("button 01"),"West");
    add(new Button("button 01"),"Center");
    add(new Button("button 01"),"North");
    add(new Button("button 01"),"South");
    setSize(300,200);
    setVisible(true);
 
        addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e){
            dispose();
            System.exit(0);
        }
    }
    );
    }
 
}
 
 
class FrameEvent  extends Frame
{
    public static void main(String[] args) throws Exception
 
    {
        new Fram();
 
    }
}
반응형
Comments