관리 메뉴

moozi

Haksa 본문

TIS_2018/응용sw2018_1기

Haksa

moozi 2018. 2. 23. 15:17

import java.awt.Container;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class Haksa extends JFrame{
 public Haksa() {
  this.setTitle("학사관리 시스템");
  this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  Container c=getContentPane();
  c.setLayout(new FlowLayout());
  
  // 새로 추가된 내용. 학번.
  c.add(new JLabel("학번"));
  JTextField tfID=new JTextField(20);
  c.add(tfID);
  
  c.add(new JLabel("이름"));
  JTextField tfName=new JTextField(20);
  c.add(tfName);
  c.add(new JLabel("학과"));
  JTextField tfDepartment=new JTextField(20);
  c.add(tfDepartment);
  c.add(new JLabel("주소"));
  JTextField tfAddress=new JTextField(20);
  c.add(tfAddress);
  
  //목록
  JTextArea ta=new JTextArea(7,23);
  c.add(new JScrollPane(ta));
  
  //버튼추가
  JButton btnInsert=new JButton("등록");
  c.add(btnInsert);
  JButton btnSelect=new JButton("목록");
  c.add(btnSelect);
  JButton btnUpdate=new JButton("수정");
  c.add(btnUpdate);
  JButton btnDelete=new JButton("삭제");
  c.add(btnDelete);
  
  
  this.setSize(300,350);
  this.setVisible(true);
 }
 public static void main(String[] args) {
  new Haksa();

 }

}


Haksa.zip


'TIS_2018 > 응용sw2018_1기' 카테고리의 다른 글

자바연습문제11  (0) 2018.02.23
스윙 컴포넌트 연습  (0) 2018.02.23
자바연습문제10  (0) 2018.02.22
자바연습문제01,03,05 풀이  (0) 2018.02.22
자바연습문제09  (0) 2018.02.21
Comments