1 / 14

시스템프로젝트

시스템프로젝트. 성적관리 프로그램 ver 1.0.1 20062042 김명지. 프로그램 개요. 성적관리 프로그램 ( 교수용 버전으로 제작됨 ) 로그 - 인을 해야만 프로그램을 볼 수 있도록 하였다 학생이름 , 학번 , 중간 / 기말고사 , 리포트 , 출석기타 점수를 입력하면 DB 로 저장되고 동시에 그래프로 출력된다 . 그래프 : 평균 90/80/70/60/50 점 이상을 출력 원 목적은 학생 한 명당 그래프 출력이었으나 변경 학생분석 , 입력 , 입력제거 , 결과출력 버튼이 있다

faunia
Download Presentation

시스템프로젝트

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 시스템프로젝트 성적관리 프로그램 ver 1.0.1 20062042 김명지

  2. 프로그램 개요 • 성적관리 프로그램(교수용 버전으로 제작됨) • 로그-인을 해야만 프로그램을 볼 수 있도록 하였다 • 학생이름, 학번, 중간/기말고사,리포트,출석기타 점수를 입력하면 DB로 저장되고 동시에 그래프로 출력된다. • 그래프 : 평균 90/80/70/60/50점 이상을 출력 • 원 목적은 학생 한 명당 그래프 출력이었으나 변경 • 학생분석, 입력, 입력제거, 결과출력 버튼이 있다 • MenuBar 사용(FileDialog)

  3. 전체 클래스 개요

  4. 주요 클래스, 메소드 • Adapter 클래스 이용(WindowListener) • StreamTokenizer이용(저장된 파일 불러올 때) • 별도의 클래스 Bt1, Bt2, Bt3, Bt4를 이용해 ActionListener 구현함 • LookAndFeel적용(로그인, 프로그램 모두) • FileDialog이용(Save, Load 기능) • Set을 이용하여 공통 속성 정의(버튼)

  5. 프로그램 프레임(로그인) • 룩앤필 적용(awt+swing) setResizable setResizable(false); setTitle WindowAdapter f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e){ System.exit(0); } }); JPassWordField LookAndFeel try{ UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch(Exception ee){}

  6. ActionListener(1) – JDBC 연동 • Class Log { • public void actionPerformed(ActionEvent e){ • Sub sb = new Sub(); • } • } • Class Sub { • public Sub(){ • String id = t1.getText(); • char pword[] = t2.getPassword(); • String pw = new String(pword); // JPasswordField • if(id.equals("admin") && pw.equals("admin")) { • ~ 성적관리 프로그램 Frame Open~ • } else { • l = new JLabel("Not authorized users!"); • l.setBounds(80, 80, 170, 30); • jf.add(l); • jf.setSize(300,200); • } • } • }

  7. Primary Key 프로그램 프레임(프로그램) Bt1,Bt2,Bt3,Bt4 MenuBar MenuItem FileDialog setEditable

  8. 소스 분석(FileDialog-Save) • fileDialog = new FileDialog(jf, "저장", FileDialog.SAVE); // 파일 • FileWriter fw; BufferedWriter bw; fileDialog.setVisible(true); • fileName = fileDialog.getDirectory() + fileDialog.getFile(); • try { • fw = new FileWriter(fileName); • bw= new BufferedWriter(fw); bw.write(ta.getText()); bw.close(); • if(fileName.equals("nullnull")){ • la1.setText(""); la2.setText("FILE SAVE 를 취소하셨습니다"); la3.setText(""); • }else{ • la1.setText(fileName); la2.setText("File이 정상적으로 SAVE 되었습니다"); la3.setText(""); • } • } catch (Exception ex) { }

  9. 소스 분석(FileDialog-Load) • fileDialog = new FileDialog(jf, "파일 열기", FileDialog.LOAD); • fileDialog.setVisible(true); • fileName = fileDialog.getDirectory() + fileDialog.getFile(); // 경로 +이름 • FileReader fr; BufferedReader br; StringWriter sw; • try { • fr = new FileReader(fileName); • br= new BufferedReader(fr); • sw = new StringWriter(); • int ch = 0; • while ((ch=br.read())!=-1) { • sw.write(ch); • } • ta.setText(sw.toString()); // TextArea에 로드한 값을 입력 • fr = new FileReader(fileName); • StreamTokenizer sT = new StreamTokenizer(fr);

  10. 소스 분석(FileDialog-Load) • while(sT.nextToken() != StreamTokenizer.TT_EOF){ • s[st2] = new Student(); • s[st2].name = sT.sval; sT.nextToken(); • s[st2].score[0] = (int)sT.nval; sT.nextToken(); • s[st2].score[1] = sT.nval; sT.nextToken(); • s[st2].score[2] = sT.nval; sT.nextToken(); • s[st2].score[3] = sT.nval; sT.nextToken(); • s[st2].score[4] = sT.nval; sT.nextToken(); • s[st2].score[5] = sT.nval; sT.nextToken(); • s[st2].score[6] = sT.nval; st++; st2++; • } • la7.setText(" "+st);a=st; • g11.setVisible(false); • g12.setVisible(false);

  11. 프로그램 실행(로그인-프로그램) ID/PW Correct ID/PW Incorrect

  12. 학생분석

  13. 입력

  14. DecimalFormat 결과출력

More Related