package CHAP09;

import javax.swing.JButton;
import javax.swing.JFrame;

public class C9_12_JButtonExample extends JFrame {

    public C9_12_JButtonExample() {       
        JButton button = new JButton("Click Me");
        
        // 버튼을 JFrame에 추가
        add(button);
        
        // JFrame 설정
        setTitle("JButton Example"); // 창 제목 설정
        setSize(300, 100);           // 창 크기 설정
        setDefaultCloseOperation(EXIT_ON_CLOSE); 
        setVisible(true);            // 창을 화면에 표시
    }
    
    public static void main(String[] args) {
        new C10_12_JButtonExample(); 
    }
}