ImageVerifierCode 换一换
格式:DOCX , 页数:43 ,大小:74.14KB ,
资源ID:8989376      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-8989376.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(java课程设计班级管理系统.docx)为本站会员(b****0)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

java课程设计班级管理系统.docx

1、java课程设计班级管理系统Java课程设计-简单的班级管理系统学院:船山学院 班级:计算机029班姓名: 陈 强 学号: 2004-12-20一:需求分析1.功能需求1).能够实现对班级学生基本资料的录入,包括学生的学号,姓名,性别,所学专业,家庭住址以及出生年月等。2).能够实现对学生基本资料的修改。3).根据学号对学生资料进行查询。4).能够删除某些学生的资料。二:总体设计 本班级管理系统共有6个java源文件。类之间的主要关系如下图所示: StudentManager(主类)DeleteStudentStudentSituationModiifySituationInquest各主类的

2、主要作用如下:1).该java文件的类负责创建班级学生管理系统的主窗口。该类包含main方法,程序从该类开始执行。2).该文件的类负责创建班级学生管理系统的学生信息录入界面。3).该文件的类负责创建班级学生管理系统的学生基本信息修改界面。4).该文件的类负责创建班级学生管理系统的学生基本信息查询界面。5).该文件的类负责创建班级学生管理系统的学生信息删除界面。6).负责创建存放学生信息的对象。三:详细设计1 主类1).成员变量主要成员变量成员变量描述变量类型变量名称基本信息录入界面基本信息修改界面基本信息查询界面基本信息删除界面菜单选项 存基本信息的散列表存放散列表的文件StudentSitu

3、ationModifySituationInquestDeleteJMenuItemHashtableFile基本信息录入基本信息修改基本信息查询基本信息删除录入,修改,查询,删除基本信息file2).方法主要方法名称功能备注StudentManageractionPerformedmain创建程序主窗口 处理ActionEvent事件程序开始运行构造方法接口方法3).代码import .*;import .*;import .*;import class StudentManager extends JFrame implements ActionListener StudentSituat

4、ion 基本信息录入=null; ModifySituation 基本信息修改=null; Inquest 基本信息查询=null; Delete 基本信息删除=null; JMenuBar bar; JMenu fileMenu; JMenuItem 录入,修改,查询,删除,退出; Container con=null; Hashtable 基本信息=null; File file=null; CardLayout card=null; JLabel label; JPanel pCenter; public StudentManager() setTitle(欢迎进入班级管理系统); 录入

5、=new JMenuItem(录入学生基本信息); 修改=new JMenuItem(修改学生基本信息); 查询=new JMenuItem(查询学生基本信息); 删除=new JMenuItem(删除学生基本信息); 退出=new JMenuItem(退出本系统); 退出.addActionListener(new ActionListener() public void actionPerformed(ActionEvent event) (0); ); bar=new JMenuBar(); fileMenu=new JMenu(菜单选项); (录入); (); (修改); (); (查

6、询); (); (删除); (); (); (退出); (fileMenu); setJMenuBar(bar); label=new JLabel(欢迎进入班级管理系统!,; (new Font(隶书,30); ; 基本信息=new Hashtable(); 录入.addActionListener(this); 修改.addActionListener(this); 查询.addActionListener(this); 删除.addActionListener(this); card=new CardLayout(); con=getContentPane(); pCenter=new

7、JPanel(); (card); file=new File(学生基本信息.txt); if(!() try FileOutputStream out=new FileOutputStream(file); ObjectOutputStreamobjectOut=new ObjectOutputStream(out); (基本信息); (); (); catch(IOException e) 基本信息录入=new StudentSituation(file); 基本信息修改=new ModifySituation(file); 基本信息查询=new Inquest(this,file); 基

8、本信息删除=new Delete(file); (欢迎语界面,label); (录入界面,基本信息录入); (修改界面,基本信息修改); (删除界面,基本信息删除); (pCenter,; (); addWindowListener(new WindowAdapter() public void windowClosing(WindowEvent e) (0); ); setVisible(true); setBounds(100,50,420,380); validate(); public void actionPerformed(ActionEvent e) if()=录入) (pCen

9、ter,录入界面); else if()=修改) (pCenter,修改界面); else if()=查询) 基本信息查询.setVisible(true); else if()=删除) (pCenter,删除界面); public static void main(String args) new StudentManager(); 2.录入界面1).成员变量主要成员变量属性描述变量类型变量名称存放“学生”对象的散列表输入学生基本信息的文本存放学生信息的对象HashtableJTextFieldStudent基本信息表学号,姓名,所学专业,家庭住址,出生学生2).方法主要方法名称功能备注St

10、udentSituationactionPerformed创建学生信息录入界面处理ActionEvent事件构造方法接口方法3).代码import .*;import .*;import .*;import .*;public class StudentSituation extends JPanel implements ActionListener Hashtable 基本信息表=null; JTextField 学号,姓名,所学专业,家庭住址,出生; JRadioButton 男,女; Student 学生=null; ButtonGroup group=null; JButton 录入

11、,重置; FileInputStream inOne=null; ObjectInputStream inTwo=null; FileOutputStream outOne=null; ObjectOutputStream outTwo=null; File file=null; public StudentSituation(File file) =file; 学号=new JTextField(10); 姓名=new JTextField(10); 所学专业=new JTextField(10); 家庭住址=new JTextField(10); 出生=new JTextField(10)

12、; group=new ButtonGroup(); 男=new JRadioButton(男,true); 女=new JRadioButton(女,false); (男); (女); 录入=new JButton(录入); 重置=new JButton(重置); 录入.addActionListener(this); 重置.addActionListener(this); Box box1=(); (new JLabel(学号:,); (学号); Box box2=(); (new JLabel(姓名:,); (姓名); Box box3=(); (new JLabel(性别:,); (男

13、); (女); Box box4=(); (new JLabel(所学专业:,); (所学专业); Box box5=(); (new JLabel(家庭住址:,); (家庭住址); Box box6=(); (new JLabel(出生:,); (出生); Box boxH=(); (box1); (box2); (box3); (box4); (box5); (box6); (); JPanel pCenter=new JPanel(); (boxH); setLayout(new BorderLayout(); add(pCenter,; JPanel pSouth=new JPanel

14、(); (录入); (重置); add(pSouth,; validate(); public void actionPerformed(ActionEvent e) if()=录入) String number=; number=学号.getText(); if()0) try inOne=new FileInputStream(file); inTwo=new ObjectInputStream(inOne); 基本信息表=(Hashtable)(); (); (); catch(Exception ee) if(基本信息表.containsKey(number) String warni

15、ng=该生基本信息已存在,请到修改页面修改!; (this,warning,警告,; else String m=基本信息将被录入!; intok=(this,m,确认,; if(ok= String name=姓名.getText(); String discipling=所学专业.getText(); String grade=家庭住址.getText(); String borth=出生.getText(); String sex=null; if(男.isSelected() sex=男.getText(); else sex=女.getText(); 学生=new Student()

16、; 学生.setNumber(number); 学生.setName(name); 学生.setDiscipling(discipling); 学生.setGrade(grade); 学生.setBorth(borth); 学生.setSex(sex); try outOne=new FileOutputStream(file); outTwo=new ObjectOutputStream(outOne); 基本信息表.put(number,学生); (基本信息表); (); (); 学号.setText(null); 姓名.setText(null); 所学专业.setText(null);

17、 家庭住址.setText(null); 出生.setText(null); catch(Exception ee) else String warning=必须要输入学号!; (this,warning,警告,; if()=重置) 学号.setText(null); 姓名.setText(null); 所学专业.setText(null); 家庭住址.setText(null); 出生.setText(null); 3.查询界面1).成员变量主要成员变量属性描述变量类型变量名称存放“学生”对象的散表显示学生基本信息的文本HashtableJTextField基本信息表学号,姓名,所学专业,家

18、庭住址,出生2).方法主要方法名称功能备注InquestactionPerformed创建查询界面处理ActionEvent事件构造方法接口方法3).代码import .*;import .*;import .*;import .*;public class Inquest extends JDialog implements ActionListener Hashtable 基本信息表=null; JTextField 学号,姓名,所学专业,家庭住址,出生; JRadioButton 男,女; JButton 查询; ButtonGroup group=null; FileInputStre

19、am inOne=null; ObjectInputStream inTwo=null; File file=null; public Inquest(JFrame f,File file) super(f,查询对话框,false); =file; 学号=new JTextField(10); 查询=new JButton(查询); 学号.addActionListener(this); 查询.addActionListener(this); 姓名=new JTextField(10); 姓名.setEditable(false); 所学专业=new JTextField(10); 所学专业.

20、setEditable(false); 家庭住址=new JTextField(10); 家庭住址.setEditable(false); 出生=new JTextField(10); 出生.setEditable(false); 男=new JRadioButton(男,false); 女=new JRadioButton(女,false); group=new ButtonGroup(); (男); (女); Box box1=(); (new JLabel(输入要查询的学号:,); (学号); (查询); Box box2=(); (new JLabel(姓名:,); (姓名); Box

21、 box3=(); (new JLabel(性别:,); (男); (女); Box box4=(); (new JLabel(所学专业:,); (所学专业); Box box5=(); (new JLabel(家庭住址:,); (家庭住址); Box box6=(); (new JLabel(出生:,); (出生); Box boxH=(); (box1); (box2); (box3); (box4); (box5); (box6); (); JPanel pCenter=new JPanel(); (boxH); Container con=getContentPane(); (pCen

22、ter,; (); setVisible(false); setBounds(100,200,360,270); addWindowListener(new WindowAdapter() public void windowClosing(WindowEvent e) setVisible(false); ); public void actionPerformed(ActionEvent e) 姓名.setText(null); 所学专业.setText(null); 家庭住址.setText(null); 出生.setText(null); if()=查询|()=学号) String n

23、umber=; number=学号.getText(); if()0) try inOne=new FileInputStream(file); inTwo=new ObjectInputStream(inOne); 基本信息表=(Hashtable)(); (); (); catch(Exception ee) if(基本信息表.containsKey(number) Student stu=(Student)基本信息表.get(number); 姓名.setText(); 所学专业.setText(); 家庭住址.setText(); 出生.setText(); if().equals(男

24、) 男.setSelected(true); else 女.setSelected(true); else String warning=该学号不存在!; (this,warning,警告,; else String warning=必须要输入学号!; (this,warning,警告,; 3.修改界面1).成员变量主要成员变量描述变量类型变量名称存放“学生”对象的散列表输入学生基本信息的文本条HashtabelJTextField基本信息表学号,姓名,所学专业,家庭住址,出生2).方法主要方法名称功能备注ModifySituationactionPerform创建学生信息修改界面处理Acti

25、onEvent事件构造方法接口方法3).代码import .*;import .*;import .*;import .*;public class ModifySituation extends JPanel implements ActionListener Hashtable 基本信息表=null; JTextField 学号,姓名,所学专业,家庭住址,出生; JRadioButton 男,女; ButtonGroup group=null; JButton 开始修改,录入修改,重置; FileInputStream inOne=null; ObjectInputStream inTwo

26、=null; FileOutputStream outOne=null; ObjectOutputStream outTwo=null; File file=null; public ModifySituation(File file) =file; 学号=new JTextField(10); 姓名=new JTextField(10); 所学专业=new JTextField(10); 家庭住址=new JTextField(10); 出生=new JTextField(10); group=new ButtonGroup(); 男=new JRadioButton(男,true); 女=

27、new JRadioButton(女,false); (男); (女); 开始修改=new JButton(开始修改); 录入修改=new JButton(录入修改); 录入修改.setEnabled(false); 重置=new JButton(重置); 学号.addActionListener(this); 开始修改.addActionListener(this); 录入修改.addActionListener(this); 重置.addActionListener(this); Box box1=(); (new JLabel(输入要修改信息的学号:,); (学号); (开始修改); Box box2=(); (new JLabel(新)姓名:,); (姓名); Box box3=(); (new JLabel(新)性别:,); (男); (女); Box box4=(); (new JLabel(新)所学专业:,); (所学专业); Box box5=(); (new JLabel(新)家庭住址:,); (家庭住址); Box box6=(); (new JLabel(新)出生:,); (出生

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2