资源描述:
《用java编写学生信息管理系统.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、用java编写学生信息管理系统importjava.awt.*;importjava.awt.event.*;importjavax.swing.*;importjava.io.*;importjava.util.*;classStudentimplementsjava.io.Serializable{Stringnumber,name,specialty,grade,borth,sex;publicStudent(){};publicvoidsetNumber(Stringnumber){this.number=number;}publicStringgetNum
2、ber(){returnnumber;}publicvoidsetName(Stringname){this.name=name;}publicStringgetName(){returnname;}publicvoidsetSex(Stringsex){this.sex=sex;}publicStringgetSex(){returnsex;}publicvoidsetSpecialty(Stringspecialty){this.specialty=specialty;}publicStringgetSpecialty(){returnspecialty;}pu
3、blicvoidsetGrade(Stringgrade){this.grade=grade;}publicStringgetGrade(){returngrade;}publicvoidsetBorth(Stringborth){this.borth=borth;}publicStringgetBorth(){returnborth;}}publicclassStudentManagerextendsJFrame{JLabellb=newJLabel("录入请先输入记录,查询、删除请先输入学号,修改是对查询"+"内容改后的保存!");staticJTextFiel
4、dJnumber,Jname,Jspecialty,Jgrade,Jborth;staticJRadioButtonboy,girl;staticButtonGroupgroup=null;staticJButtonLogin,select,delete,update,show;staticJPanelp1,p2,p3,p4,p5,p6,pv,ph;staticStudentstudent=null;staticHashtableShashtable=null;staticFilefile=null;staticFileInputStreaminOne=null;s
5、taticObjectInputStreaminTwo=null;staticFileOutputStreamoutOne=null;staticObjectOutputStreamoutTwo=null;publicStudentManager(){super("学生基本信息管理系统");Jnumber=newJTextField(10);Jname=newJTextField(10);Jspecialty=newJTextField(10);Jgrade=newJTextField(10);Jborth=newJTextField(10);group=newBu
6、ttonGroup();boy=newJRadioButton("男",true);girl=newJRadioButton("女",false);group.add(boy);group.add(girl);Login=newJButton("录入");select=newJButton("查询");delete=newJButton("删除");update=newJButton("修改");show=newJButton("显示");Login.addActionListener(newInputAct());select.addActionListener(
7、newInquestAct());update.addActionListener(newModifyAct());delete.addActionListener(newDeleteAct());show.addActionListener(newShowAct());update.setEnabled(false);p1=newJPanel();p1.add(newJLabel("学号:",JLabel.CENTER));p1.add(Jnumber);p2=newJPanel();p2.add(newJLabel("姓名:",JLabel.CENTER))