import javax.swing.*;

public class Swing01 extends JFrame
{
        Swing01()
        {
               setTitle( "학생관리" ); // 프레임의 제목 설정
                setDefaultCloseOperation( JFrame. EXIT_ON_CLOSE); // 종료버튼 클릭 시 프로그램 종료
               
                // FlowLayout --------------------------------------------------------------------------------------
               
                /*Container contentpane = getContentPane(); // 컨텐트 팬을 알아낸다.
               
               contentpane.setLayout(new FlowLayout()); // FlowLayout은 차례대로 컴포넌트를 배치한다.
               contentpane.add(new JButton("Confirm"));
               contentpane.add(new JButton("Input"));*/
               
                /*setLayout(new FlowLayout(FlowLayout.LEFT, 50, 50)); // 컨테이너를 만들지 않아도 호출/구현이 가능하다...!!! (단 BG 색상 설정은 컨테이너가 필요하다.)
               // FlowLayout 디폴트값은 Center이다...! (Left로 하는게 좋을것)
               
               add(new JButton("Confirm"));
               add(new JButton("Input"));*/
               
                // BorderLayout --------------------------------------------------------------------------------------
               
                /*setLayout(new BorderLayout());
               add(new JButton("Confirm"), BorderLayout.NORTH); // 상하 간격이 유지된다.
               add(new JButton("Input"), BorderLayout.SOUTH); // 상하 간격이 유지된다.
               add(new JButton("Explore"), BorderLayout.WEST); // 좌우 간격이 유지된다.             
               add(new JButton("Attribute"), BorderLayout.EAST); // 좌우 간격이 유지된다.
               add(new JButton("Content"), BorderLayout.CENTER); // 좌우 여백이 있으면 전부 채워진다.*/
               
                // 배치관리자 없는 컨테이너 --------------------------------------------------------------------------------------
               
               setLayout( null); // 레이아웃 적용 안함
               
                JButton button1 = new JButton( "Confirm");
                button1.setLocation(10, 10); // 버튼의 위치 설정 (x좌표, y좌표)
                button1.setSize(150, 50); // 버튼의 크기 설정 (가로, 세로)
               add( button1); // 프레임에 버튼 추가
               
                JButton button2 = new JButton( "Cancel");
                button2.setLocation(180, 10);
                button2.setSize(150, 50);
               add( button2);
               
               setSize(360, 300); // 프레임의 크기 설정 (가로, 세로)
               setVisible( true); // 프레임이 화면에 나타나도록 설정 (true), false로 설정하면 화면에 나타나지 않는다.
        }
        
         public static void main(String [] args)
        {
                new Swing01(); // 인스턴스 생성
        }
}