




版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、java版學(xué)籍管理系統(tǒng)源代碼 package 學(xué)籍管理系統(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 學(xué)號(hào),姓名,專(zhuān)業(yè),年級(jí),出生; 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; 學(xué)號(hào) new jtextfield 10 ; 刪除 new jbutton 刪除 ; 學(xué)號(hào).addactionlistener this ; 刪除.addactionlistener this ; 姓名 new jtextfield 10 ; 姓名.seteditable false ; 專(zhuān)業(yè) new jtextfield 10 ; 專(zhuān)業(yè).seteditable false ; 年級(jí) new jtextfield 10 ; 年級(jí).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 輸入要?jiǎng)h除的學(xué)號(hào):,jlabel.center ; box1.add 學(xué)號(hào) ; 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 專(zhuān)業(yè):,jlabel.center ; box4.add 專(zhuān)業(yè) ; box box5 box.createhorizontalbox ; box5.add new jlabel 年級(jí):,jlabel.center ; box5.add 年
6、級(jí) ; 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 學(xué)號(hào) string number ; number 學(xué)號(hào).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 ; 專(zhuān)業(yè).settext stu.getdisciping ; 年級(jí).settext stu.getgrade ; 出生.settext stu.getborth ; if stu.getsex .equals 男 男.setselected true ; else 女.setselected
9、true ; string m 確定要?jiǎng)h除該學(xué)號(hào)及全部信息嗎?; int ok joptionpane.showconfirmdialog this,m,確認(rèn),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 ; 學(xué)號(hào).settext null ; 姓名.settext null ; 專(zhuān)業(yè).settext null ; 年級(jí).settext null ; 出生.settext null ; catch exception ee sytln ee ; else if ok joptionpane.no_option 學(xué)號(hào).settext null ; 姓名.settext null ; 專(zhuān)業(yè).settext null ; 年級(jí).settext null ; 出生.settext null ; else string warning 該學(xué)號(hào)不存在!; jopt
11、ionpane.showmessagedialog this,warning,警告,joptionpane.warning_message ; else string warning 必須要輸入學(xué)號(hào)!; joptionpane.showmessagedialog this,warning,警告,joptionpane.warning_message ; package 學(xué)籍管理系統(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 學(xué)號(hào),姓名,專(zhuān)業(yè),年級(jí),出生; jradiobutton 男,女; jbutton 查詢(xún); b
13、uttongroup group null; fileinputstream inone null; objectinputstream intwo null; file file null; public inquest jframe f,file file super f,查詢(xún)對(duì)話(huà)框,false ; this.file file; 學(xué)號(hào) new jtextfield 10 ; 查詢(xún) new jbutton 查詢(xún) ; 學(xué)號(hào).addactionlistener this ; 查詢(xún).addactionlistener this ; 姓名 new jtextfield 10 ; 姓名.setedi
14、table false ; 專(zhuān)業(yè) new jtextfield 10 ; 專(zhuān)業(yè).seteditable false ; 年級(jí) new jtextfield 10 ; 年級(jí).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 輸入要查詢(xún)的學(xué)號(hào):,jlabel.center ; box1.add 學(xué)號(hào) ; box1.add 查詢(xún) ; 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 專(zhuān)業(yè):,jlabel.center ; box4.add 專(zhuān)業(yè) ; box box5 box.createhorizontalbox ; box5.add new jlabel 年級(jí):,jlabel.center ; box5.add 年級(jí) ; 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 ; 專(zhuān)業(yè).settext null ; 年級(jí).settext null ; 出生.settext null ; if e.getsource 查詢(xún)|e.getsource 學(xué)號(hào) string number ; number 學(xué)號(hào).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 ; 專(zhuān)業(yè).settext stu.getdisciping ; 年級(jí).settext stu.getgrade ; 出生.settext stu.getborth ; if
20、stu.getsex .equals 男 男.setselected true ; else 女.setselected true ; else string warning 該學(xué)號(hào)不存在!; joptionpane.showmessagedialog this,warning,警告,joptionpane.warning_message ; else string warning 必須要輸入學(xué)號(hào)!; joptionpane.showmessagedialog this,warning,警告,joptionpane.warning_message ; package 學(xué)籍管理系統(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 學(xué)號(hào),姓名,專(zhuān)業(yè),年級(jí),出生; jradiobutton 男,女; buttongroup group null; jbutton 開(kāi)始修改,錄入修改,重置; fileinputstream inone null; objectinputstream intwo null; fileoutputstream outone null; objectoutputstream outtwo null; file file null; public modifysituation
23、file file this.file file; 學(xué)號(hào) new jtextfield 10 ; 姓名 new jtextfield 10 ; 專(zhuān)業(yè) new jtextfield 10 ; 年級(jí) new jtextfield 10 ; 出生 new jtextfield 10 ; group new buttongroup ; 男 new jradiobutton 男,true ; 女 new jradiobutton 女,false ; group.add 男 ; group.add 女 ; 開(kāi)始修改 new jbutton 開(kāi)始修改 ; 錄入修改 new jbutton 錄入修改 ; 錄入
24、修改.setenabled false ; 重置 new jbutton 重置 ; 學(xué)號(hào).addactionlistener this ; 開(kāi)始修改.addactionlistener this ; 錄入修改.addactionlistener this ; 重置.addactionlistener this ; box box1 box.createhorizontalbox ; box1.add new jlabel 輸入要修改信息的學(xué)號(hào):,jlabel.center ; box1.add 學(xué)號(hào) ; box1.add 開(kāi)始修改 ; 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 新 專(zhuān)業(yè):,jlabel.center ; box4.add 專(zhuān)業(yè) ; box box5 box.createhorizontalbox ; box5.add
26、new jlabel 新 年級(jí):,jlabel.center ; box5.add 年級(jí) ; 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 開(kāi)始修改|e.getsource 學(xué)號(hào) string n
28、umber ; number 學(xué)號(hào).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 ; 專(zhuān)業(yè).settext stu.getdisciping ; 年級(jí).settext stu.getgrade ; 出生.settext stu.getborth ; if stu.getsex .equals 男 男.setselected true ; else 女.setselected true ; else 錄入修改.setenabled false ; string warning 該學(xué)號(hào)不存在!; joptionpane.showmessagedialog this,warning,警告,joptionpane.warning_message ; 學(xué)
30、號(hào).settext null ; 姓名.settext null ; 專(zhuān)業(yè).settext null ; 年級(jí).settext null ; 出生.settext null ; else 錄入修改.setenabled false ; string warning 必須要輸入學(xué)號(hào)!; joptionpane.showmessagedialog this,warning,警告,joptionpane.warning_message ; 學(xué)號(hào).settext null ; 姓名.settext null ; 專(zhuān)業(yè).settext null ; 年級(jí).settext null ; 出生.settex
31、t null ; else if e.getsource 錄入修改 string number ; number 學(xué)號(hào).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,確認(rèn),joptionpane.yes_no_option, joptionpane.information_message ; if ok joptionpane.yes_option string name 姓名.gettext ; string discipling 專(zhuān)業(yè).gett
33、ext ; string grade 年級(jí).gettext ; string borth 出生.gettext ; string sex null; if 男.isselected sex 男.gettext ; else sex 女.gettext ; student 學(xué)生 new student ; 學(xué)生.setnumber number ; 學(xué)生.setname name ; 學(xué)生.setdiscipling discipling ; 學(xué)生.setgrade grade ; 學(xué)生.setborth borth ; 學(xué)生.setsex sex ; try outone new fileou
34、tputstream file ; outtwo new objectoutputstream outone ; 基本信息表.put number,學(xué)生 ; outtwo.writeobject 基本信息表 ; outtwo.close ; outone.close ; 學(xué)號(hào).settext null ; 姓名.settext null ; 專(zhuān)業(yè).settext null ; 年級(jí).settext null ; 出生.settext null ; catch exception ee sytln ee ; 錄入修改.setenabled false ; else if ok joptionpa
35、ne.no_option 錄入修改.setenabled true ; else string warning 該學(xué)號(hào)沒(méi)有基本信息,不能修改!; joptionpane.showmessagedialog this,warning,警告,joptionpane.warning_message ; 錄入修改.setenabled false ; else string warning 必須要輸入學(xué)號(hào)!; joptionpane.showmessagedialog this,warning,警告,joptionpane.warning_message ; 錄入修改.setenabled false ; if e.getsource 重置 學(xué)號(hào).settext null ; 姓名.settext null ; 專(zhuān)業(yè).settext null ; 年級(jí).settext null ; 出生.settext null ; package 學(xué)籍管理系統(tǒng);/* * to change this template, choose tools | templates * and open the template in the editor. */* * * author adm
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 關(guān)于黃岡的七下數(shù)學(xué)試卷
- 貨品分析培訓(xùn)課件圖片
- 肥城中考數(shù)學(xué)試卷
- 肛腸五項(xiàng)技術(shù)課件
- 燈塔市期末考試數(shù)學(xué)試卷
- 浮山中學(xué)數(shù)學(xué)試卷
- 高級(jí)中學(xué)期末數(shù)學(xué)試卷
- 2025年06月浙江溫州市蒼南縣衛(wèi)生健康系統(tǒng)面向社會(huì)招聘120編外輔助人員2人筆試歷年專(zhuān)業(yè)考點(diǎn)(難、易錯(cuò)點(diǎn))附帶答案詳解
- 2025年01月2025安徽池州市人民醫(yī)院勞務(wù)派遣辦公室文員招聘1人筆試歷年專(zhuān)業(yè)考點(diǎn)(難、易錯(cuò)點(diǎn))附帶答案詳解
- 銷(xiāo)售技能培訓(xùn)課件分類(lèi)
- 2023年本科招生考試
- 碳捕集、利用與封存技術(shù)課件
- 碳達(dá)峰和“碳中和”環(huán)境知識(shí)科普宣傳PPT教學(xué)課件
- 中文版b4a新手指南-第14-15章語(yǔ)言畫(huà)圖
- 新入職護(hù)士培訓(xùn)考試試題及答案
- 《消防安全技術(shù)實(shí)務(wù)》課本完整版
- 公路工程標(biāo)準(zhǔn)施工監(jiān)理招標(biāo)文件(2018年版)
- 北師大版七年級(jí)數(shù)學(xué)下冊(cè) 與信息技術(shù)相融合的數(shù)學(xué)教學(xué)案例 教案
- 鈍針穿刺法臨床應(yīng)用護(hù)理
- 精品中文版b4a新手指南第4章開(kāi)發(fā)環(huán)境
- 光纜線路的故障分析及障礙搶修
評(píng)論
0/150
提交評(píng)論