

package ex0306;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextField;
public class GUIThreadExam extends JFrame {
// 컴포넌트 준비
JTextField text1 = new JTextField(5);
JTextField text2 = new JTextField(5);
JButton btn = new JButton("확인");
public GUIThreadExam() { //기본배치도 보더레이아웃?
super("1초 시계");
super.setLayout(new FlowLayout());
//컨테이너=창 //각각 쓰레드여야함...
Container con= super.getContentPane();
con.add(text1, BorderLayout.NORTH);
con.add(text2);
con.add(btn);
super.setSize(250,500);
super.setLocationRelativeTo(null);
super.setVisible(true);
super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args) {
new GUIThreadExam();
}
}