본문 바로가기

개발/Java

[JAVA 개발] 패널(Panel) 확인, 취소 소스_1

반응형

import javax.swing.*;
import java.awt.*;

class Exam2 extends JFrame {
 private Button bt = new Button("확인");
 private Button bt1 = new Button("취소");
 
 private GridLayout gl =new GridLayout(1,2); //1행 2열
 
 public Exam2(String title){ 
  super(title); 
  this.init();
  /*
   * 위치 설정
   */
  super.setSize(300,200);
  super.setLocation(400, 500);
  super.setResizable(false);
  super.setVisible(true);
 }
 /*
  * 레이아웃 설정
  */
 public void init(){
  this.setLayout(gl);
  this.add(bt);
  this.add(bt1);
 }
}


public class Exam2Test {

 public static void main(String[] args) {
  Exam2 ex = new Exam2("확인버튼 만들기");

 }

}

반응형