청춘만화 2012. 3. 4. 11:06

/*
import java.awt.*;

public class Test001 {
public static void main(String[] args) {
Frame f =new Frame("TEST"); //선언만된 상태(작업표시줄 내용)
//f.setSize(400, 400);
//f.setLocation(100, 100);
//f.show(); //예전버전
f.setBounds(100, 100, 400, 400);
f.setVisible(true);
}

}
**/


/*
import java.awt.*;

public class Test001 {
static Frame f=null;
public static void main(String[] args) {
f =new Frame("TEST"); //선언만된 상태(작업표시줄 내용)
//f.setSize(400, 400);
//f.setLocation(100, 100);
//f.show(); //예전버전
Button b1 = new Button("버튼1");
f.add(b1); 
f.setBounds(100, 100, 400, 400);
f.setVisible(true);
}
}**/



/*
import java.awt.*;

public class Test001 {
static Frame f=null;
public static void main(String[] args) {
f =new Frame("TEST"); //선언만된 상태(작업표시줄 내용)
FlowLayout fw = new FlowLayout();
f.setLayout(fw); //가운데정렬
Button b1 = new Button("버튼1");
f.add(b1); 
f.setBounds(100, 100, 400, 400);
f.setVisible(true);
}
}**/


/*
import java.awt.*;

public class Test001 {
static Frame f=null;
public static void main(String[] args) {
f =new Frame("TEST"); //선언만된 상태(작업표시줄 내용)
FlowLayout fw = new FlowLayout();
f.setLayout(fw); //가운데정렬 + 윈도우 사이즈가 작아지면 위치 및 배열이 자동으로 바뀜.
Button b1 = new Button("버튼1");
Button b2 = new Button("버튼2");
Button b3 = new Button("버튼3");
Button b4 = new Button("버튼4");
Button b5 = new Button("버튼5");
Button b6 = new Button("버튼6");
f.add(b1);
f.add(b2);
f.add(b3);
f.add(b4);
f.add(b5);
f.add(b6);
f.setBounds(100, 100, 400, 400);
f.setVisible(true);
}
}**/


import java.awt.*;

public class Test001 {
static Frame f=null;
public static void main(String[] args) {
f =new Frame("TEST"); //선언만된 상태(작업표시줄 내용)
// FlowLayout fw = new FlowLayout();
f.setLayout(new FlowLayout()); 
// Button b1 = new Button("버튼1");
// Button b2 = new Button("버튼2");
// Button b3 = new Button("버튼3");
// Button b4 = new Button("버튼4");
// Button b5 = new Button("버튼5");
// Button b6 = new Button("버튼6");
f.add(new Button("버튼1"));
f.add(new Button("버튼2"));
f.add(new Button("버튼3"));
f.add(new Button("버튼4"));
f.add(new Button("버튼5"));
f.add(new Button("버튼6")); // 다시 쓸일이 없을 경우 
// 불필요한 객체정의 보단 바로 값을 넣는다.
f.setBounds(100, 100, 400, 400);
f.setVisible(true);
}
}