版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領
文檔簡介
1、java版學籍管理系統(tǒng)源代碼 package 學籍管理系統(tǒng);/* * to change this template, choose tools | templates * and open the template in the editor. */* * * author administrator */import java.awt.*;import t.*;import javax.swing.*;import java.io.*;import java.util.*;public class delete extends jpanel implements actionlistene
2、r /* * */private static final long serialversionuid 1l;hashtable 基本信息表 null; jtextfield 學號,姓名,專業(yè),年級,出生; jradiobutton 男,女; jbutton 刪除; buttongroup group null; fileinputstream inone null; objectinputstream intwo null; fileoutputstream outone null; objectoutputstream outtwo null; file file null; public
3、 delete file file this.file file; 學號 new jtextfield 10 ; 刪除 new jbutton 刪除 ; 學號.addactionlistener this ; 刪除.addactionlistener this ; 姓名 new jtextfield 10 ; 姓名.seteditable false ; 專業(yè) new jtextfield 10 ; 專業(yè).seteditable false ; 年級 new jtextfield 10 ; 年級.seteditable false ; 出生 new jtextfield 10 ; 出生.set
4、editable false ; 男 new jradiobutton 男,false ; 女 new jradiobutton 女,false ; group new buttongroup ; group.add 男 ; group.add 女 ; box box1 box.createhorizontalbox ; box1.add new jlabel 輸入要刪除的學號:,jlabel.center ; box1.add 學號 ; box1.add 刪除 ; box box2 box.createhorizontalbox ; box2.add new jlabel 姓名:,jlabe
5、l.center ; box2.add 姓名 ; box box3 box.createhorizontalbox ; box3.add new jlabel 性別:,jlabel.center ; box3.add 男 ; box3.add 女 ; box box4 box.createhorizontalbox ; box4.add new jlabel 專業(yè):,jlabel.center ; box4.add 專業(yè) ; box box5 box.createhorizontalbox ; box5.add new jlabel 年級:,jlabel.center ; box5.add 年
6、級 ; box box6 box.createhorizontalbox ; box6.add new jlabel 出生:,jlabel.center ; box6.add 出生 ; box boxh box.createverticalbox ; boxh.add box1 ; boxh.add box2 ; boxh.add box3 ; boxh.add box4 ; boxh.add box5 ; boxh.add box6 ; boxh.add box.createverticalglue ; jpanel pcenter new jpanel ; pcenter.add boxh
7、 ; setlayout new borderlayout ; add pcenter,borderlayout.center ; validate ; public void actionperformed actionevent e if e.getsource 刪除|e.getsource 學號 string number ; number 學號.gettext ; if number.length 0 try inone new fileinputstream file ; intwo new objectinputstream inone ; 基本信息表 hashtable intw
8、o.readobject ; inone.close ; intwo.close ; catch exception ee if 基本信息表.containskey number student stu student 基本信息表.get number ; 姓名.settext stu.getname ; 專業(yè).settext stu.getdisciping ; 年級.settext stu.getgrade ; 出生.settext stu.getborth ; if stu.getsex .equals 男 男.setselected true ; else 女.setselected
9、true ; string m 確定要刪除該學號及全部信息嗎?; int ok joptionpane.showconfirmdialog this,m,確認,joptionpane.yes_no_option, joptionpane.question_message ; if ok joptionpane.yes_option 基本信息表.remove number ; try outone new fileoutputstream file ; outtwo new objectoutputstream outone ; outtwo.writeobject 基本信息表 ; outtwo
10、.close ; outone.close ; 學號.settext null ; 姓名.settext null ; 專業(yè).settext null ; 年級.settext null ; 出生.settext null ; catch exception ee sytln ee ; else if ok joptionpane.no_option 學號.settext null ; 姓名.settext null ; 專業(yè).settext null ; 年級.settext null ; 出生.settext null ; else string warning 該學號不存在!; jopt
11、ionpane.showmessagedialog this,warning,警告,joptionpane.warning_message ; else string warning 必須要輸入學號!; joptionpane.showmessagedialog this,warning,警告,joptionpane.warning_message ; package 學籍管理系統(tǒng);/* * to change this template, choose tools | templates * and open the template in the editor. */* * * autho
12、r administrator */import java.awt.*;import t.*;import javax.swing.*;import java.io.*;import java.util.*;public class inquest extends jdialog implements actionlistener /* * */private static final long serialversionuid 1l;hashtable 基本信息表 null; jtextfield 學號,姓名,專業(yè),年級,出生; jradiobutton 男,女; jbutton 查詢; b
13、uttongroup group null; fileinputstream inone null; objectinputstream intwo null; file file null; public inquest jframe f,file file super f,查詢對話框,false ; this.file file; 學號 new jtextfield 10 ; 查詢 new jbutton 查詢 ; 學號.addactionlistener this ; 查詢.addactionlistener this ; 姓名 new jtextfield 10 ; 姓名.setedi
14、table false ; 專業(yè) new jtextfield 10 ; 專業(yè).seteditable false ; 年級 new jtextfield 10 ; 年級.seteditable false ; 出生 new jtextfield 10 ; 出生.seteditable false ; 男 new jradiobutton 男,false ; 女 new jradiobutton 女,false ; group new buttongroup ; group.add 男 ; group.add 女 ; box box1 box.createhorizontalbox ; box
15、1.add new jlabel 輸入要查詢的學號:,jlabel.center ; box1.add 學號 ; box1.add 查詢 ; box box2 box.createhorizontalbox ; box2.add new jlabel 姓名:,jlabel.center ; box2.add 姓名 ; box box3 box.createhorizontalbox ; box3.add new jlabel 性別:,jlabel.center ; box3.add 男 ; box3.add 女 ; box box4 box.createhorizontalbox ; box4
16、.add new jlabel 專業(yè):,jlabel.center ; box4.add 專業(yè) ; box box5 box.createhorizontalbox ; box5.add new jlabel 年級:,jlabel.center ; box5.add 年級 ; box box6 box.createhorizontalbox ; box6.add new jlabel 出生:,jlabel.center ; box6.add 出生 ; box boxh box.createverticalbox ; boxh.add box1 ; boxh.add box2 ; boxh.ad
17、d box3 ; boxh.add box4 ; boxh.add box5 ; boxh.add box6 ; boxh.add box.createverticalglue ; jpanel pcenter new jpanel ; pcenter.add boxh ; container con getcontentpane ; con.add pcenter,borderlayout.center ; con.validate ; setvisible false ; setbounds 100,200,360,270 ; addwindowlistener new windowada
18、pter public void windowclosing windowevent e setvisible false ; ; public void actionperformed actionevent e 姓名.settext null ; 專業(yè).settext null ; 年級.settext null ; 出生.settext null ; if e.getsource 查詢|e.getsource 學號 string number ; number 學號.gettext ; if number.length 0 try inone new fileinputstream fi
19、le ; intwo new objectinputstream inone ; 基本信息表 hashtable intwo.readobject ; inone.close ; intwo.close ; catch exception ee if 基本信息表.containskey number student stu student 基本信息表.get number ; 姓名.settext stu.getname ; 專業(yè).settext stu.getdisciping ; 年級.settext stu.getgrade ; 出生.settext stu.getborth ; if
20、stu.getsex .equals 男 男.setselected true ; else 女.setselected true ; else string warning 該學號不存在!; joptionpane.showmessagedialog this,warning,警告,joptionpane.warning_message ; else string warning 必須要輸入學號!; joptionpane.showmessagedialog this,warning,警告,joptionpane.warning_message ; package 學籍管理系統(tǒng);/* * t
21、o change this template, choose tools | templates * and open the template in the editor. */* * * author administrator */import java.awt.*;import t.*;import javax.swing.*;import java.io.*;import java.util.*;public class modifysituation extends jpanel implements actionlistener /* * */private static fin
22、al long serialversionuid 1l;hashtable 基本信息表 null; jtextfield 學號,姓名,專業(yè),年級,出生; jradiobutton 男,女; buttongroup group null; jbutton 開始修改,錄入修改,重置; fileinputstream inone null; objectinputstream intwo null; fileoutputstream outone null; objectoutputstream outtwo null; file file null; public modifysituation
23、file file this.file file; 學號 new jtextfield 10 ; 姓名 new jtextfield 10 ; 專業(yè) new jtextfield 10 ; 年級 new jtextfield 10 ; 出生 new jtextfield 10 ; group new buttongroup ; 男 new jradiobutton 男,true ; 女 new jradiobutton 女,false ; group.add 男 ; group.add 女 ; 開始修改 new jbutton 開始修改 ; 錄入修改 new jbutton 錄入修改 ; 錄入
24、修改.setenabled false ; 重置 new jbutton 重置 ; 學號.addactionlistener this ; 開始修改.addactionlistener this ; 錄入修改.addactionlistener this ; 重置.addactionlistener this ; box box1 box.createhorizontalbox ; box1.add new jlabel 輸入要修改信息的學號:,jlabel.center ; box1.add 學號 ; box1.add 開始修改 ; box box2 box.createhorizontal
25、box ; box2.add new jlabel 新 姓名:,jlabel.center ; box2.add 姓名 ; box box3 box.createhorizontalbox ; box3.add new jlabel 新 性別:,jlabel.center ; box3.add 男 ; box3.add 女 ; box box4 box.createhorizontalbox ; box4.add new jlabel 新 專業(yè):,jlabel.center ; box4.add 專業(yè) ; box box5 box.createhorizontalbox ; box5.add
26、new jlabel 新 年級:,jlabel.center ; box5.add 年級 ; box box6 box.createhorizontalbox ; box6.add new jlabel 新 出生:,jlabel.center ; box6.add 出生 ; box boxh box.createverticalbox ; boxh.add box1 ; boxh.add box2 ; boxh.add box3 ; boxh.add box4 ; boxh.add box5 ; boxh.add box6 ; boxh.add box.createverticalglue ;
27、 jpanel pcenter new jpanel ; pcenter.add boxh ; setlayout new borderlayout ; add pcenter,borderlayout.center ; jpanel psouth new jpanel ; psouth.add 錄入修改 ; psouth.add 重置 ; add psouth,borderlayout.south ; validate ; public void actionperformed actionevent e if e.getsource 開始修改|e.getsource 學號 string n
28、umber ; number 學號.gettext ; if number.length 0 try inone new fileinputstream file ; intwo new objectinputstream inone ; 基本信息表 hashtable intwo.readobject ; inone.close ; intwo.close ; catch exception ee if 基本信息表.containskey number 錄入修改.setenabled true ; student stu student 基本信息表.get number ; 姓名.sette
29、xt stu.getname ; 專業(yè).settext stu.getdisciping ; 年級.settext stu.getgrade ; 出生.settext stu.getborth ; if stu.getsex .equals 男 男.setselected true ; else 女.setselected true ; else 錄入修改.setenabled false ; string warning 該學號不存在!; joptionpane.showmessagedialog this,warning,警告,joptionpane.warning_message ; 學
30、號.settext null ; 姓名.settext null ; 專業(yè).settext null ; 年級.settext null ; 出生.settext null ; else 錄入修改.setenabled false ; string warning 必須要輸入學號!; joptionpane.showmessagedialog this,warning,警告,joptionpane.warning_message ; 學號.settext null ; 姓名.settext null ; 專業(yè).settext null ; 年級.settext null ; 出生.settex
31、t null ; else if e.getsource 錄入修改 string number ; number 學號.gettext ; if number.length 0 try inone new fileinputstream file ; intwo new objectinputstream inone ; 基本信息表 hashtable intwo.readobject ; inone.close ; intwo.close ; catch exception ee if 基本信息表.containskey number string question 該生基本信息已存在,您想
32、修改他 她 的基本信息嗎?; joptionpane.showmessagedialog this,question,警告,joptionpane.question_message ; string m 基本信息將被修改!; int ok joptionpane.showconfirmdialog this,m,確認,joptionpane.yes_no_option, joptionpane.information_message ; if ok joptionpane.yes_option string name 姓名.gettext ; string discipling 專業(yè).gett
33、ext ; string grade 年級.gettext ; string borth 出生.gettext ; string sex null; if 男.isselected sex 男.gettext ; else sex 女.gettext ; student 學生 new student ; 學生.setnumber number ; 學生.setname name ; 學生.setdiscipling discipling ; 學生.setgrade grade ; 學生.setborth borth ; 學生.setsex sex ; try outone new fileou
34、tputstream file ; outtwo new objectoutputstream outone ; 基本信息表.put number,學生 ; outtwo.writeobject 基本信息表 ; outtwo.close ; outone.close ; 學號.settext null ; 姓名.settext null ; 專業(yè).settext null ; 年級.settext null ; 出生.settext null ; catch exception ee sytln ee ; 錄入修改.setenabled false ; else if ok joptionpa
35、ne.no_option 錄入修改.setenabled true ; else string warning 該學號沒有基本信息,不能修改!; joptionpane.showmessagedialog this,warning,警告,joptionpane.warning_message ; 錄入修改.setenabled false ; else string warning 必須要輸入學號!; joptionpane.showmessagedialog this,warning,警告,joptionpane.warning_message ; 錄入修改.setenabled false ; if e.getsource 重置 學號.settext null ; 姓名.settext null ; 專業(yè).settext null ; 年級.settext null ; 出生.settext null ; package 學籍管理系統(tǒng);/* * to change this template, choose tools | templates * and open the template in the editor. */* * * author adm
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 科技企業(yè)研發(fā)實驗室的標準化實踐分享
- 輕松做營養(yǎng)-為孕婦打造的烹飪技巧和菜譜分享
- 2025年度蔬菜批發(fā)市場加盟經(jīng)營合同
- 2025年度高新技術(shù)企業(yè)專利質(zhì)押合同樣本
- 二零二五年度汽車銷售與售后服務股份轉(zhuǎn)讓合同
- 二零二五年度電影投資收益分配居間服務合同
- 2025年度企業(yè)稅收籌劃與稅務風險防范及稅務咨詢合同
- 2025年度房地產(chǎn)公司聘用工作人員銷售代理合同
- 移動辦公環(huán)境下的安全產(chǎn)品設計考量
- 科技園區(qū)的綠色生態(tài)與空間美學構(gòu)建
- 主題一:人文之美 第7課《天下第一大佛-樂山大佛》 課件
- 印度與阿拉伯的數(shù)學
- 口腔科院感知識培訓針刺傷
- 會陰切開傷口裂開的護理查房
- 《鋼鐵是怎樣煉成的》選擇題100題(含答案)
- 2024年國新國際投資有限公司招聘筆試參考題庫含答案解析
- 食堂餐廳服務方案投標方案(技術(shù)標)
- Creo-7.0基礎教程-配套課件
- 六年級人教版上冊數(shù)學計算題練習題(及答案)100解析
- 超聲科質(zhì)量控制制度及超聲科圖像質(zhì)量評價細則
- 初中物理滬粵版八年級下冊《第六章 力和機械》章節(jié)練習(含答案)
評論
0/150
提交評論