




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(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),姓名,專業(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 ; 專業(yè) new jtextfield 10 ; 專業(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 專業(yè):,jlabel.center ; box4.add 專業(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 ; 專業(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 ; 專業(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 ; 專業(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),姓名,專業(yè),年級(jí),出生; jradiobutton 男,女; jbutton 查詢; b
13、uttongroup group null; fileinputstream inone null; objectinputstream intwo null; file file null; public inquest jframe f,file file super f,查詢對(duì)話框,false ; this.file file; 學(xué)號(hào) new jtextfield 10 ; 查詢 new jbutton 查詢 ; 學(xué)號(hào).addactionlistener this ; 查詢.addactionlistener this ; 姓名 new jtextfield 10 ; 姓名.setedi
14、table false ; 專業(yè) new jtextfield 10 ; 專業(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 輸入要查詢的學(xué)號(hào):,jlabel.center ; box1.add 學(xué)號(hào) ; 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 年級(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 ; 專業(yè).settext null ; 年級(jí).settext null ; 出生.settext null ; if e.getsource 查詢|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 ; 專業(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),姓名,專業(yè),年級(jí),出生; 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; 學(xué)號(hào) new jtextfield 10 ; 姓名 new jtextfield 10 ; 專業(yè) new jtextfield 10 ; 年級(jí) 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 重置 ; 學(xué)號(hào).addactionlistener this ; 開始修改.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 開始修改 ; 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 新 年級(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 開始修改|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 ; 專業(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 ; 專業(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 ; 專業(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 專業(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 ; 專業(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)沒有基本信息,不能修改!; 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 ; 專業(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)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 中暑防治課件圖片
- 葡萄地農(nóng)資采購(gòu)合同范本
- 中小學(xué)生課件法律
- 2025標(biāo)準(zhǔn)茶葉買賣合同范本
- 2025化工產(chǎn)品長(zhǎng)途運(yùn)輸合同范本
- 電源開關(guān)電源設(shè)計(jì)工程師合同
- 2025倉(cāng)庫(kù)租賃合同書
- 2025浙江某銀行信貸財(cái)產(chǎn)收益權(quán)轉(zhuǎn)讓合同優(yōu)先級(jí)
- 護(hù)理??撇僮骷寄?/a>
- 截癱伴糖尿病護(hù)理
- 2025年省國(guó)有資本運(yùn)營(yíng)控股集團(tuán)有限公司人員招聘筆試備考試題及答案詳解(名校卷)
- 2025年輔警招聘考試試題庫(kù)完整答案
- 宿州蕭縣鄉(xiāng)鎮(zhèn)事業(yè)單位招聘考試真題2024
- 2025至2030全球及中國(guó)近炸引信傳感器行業(yè)項(xiàng)目調(diào)研及市場(chǎng)前景預(yù)測(cè)評(píng)估報(bào)告
- 部編版三年級(jí)語(yǔ)文上冊(cè) 寫字表
- 工廠十周年活動(dòng)策劃方案
- 黑啟動(dòng)操作培訓(xùn)課件
- 天津匯融商業(yè)管理有限公司招聘筆試題庫(kù)2025
- 腫瘤的健康科普
- 廣東教育學(xué)院德育研究中心
- 2025至2030中國(guó)清潔機(jī)器人市場(chǎng)經(jīng)營(yíng)效益與投融資發(fā)展?fàn)顩r報(bào)告
評(píng)論
0/150
提交評(píng)論