《最新java课程设计报告---副本.doc》由会员分享,可在线阅读,更多相关《最新java课程设计报告---副本.doc(63页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、Four short words sum up what has lifted most successful individuals above the crowd: a little bit more.-author-datejava课程设计报告-副本课程设计报告格式 吉林大学软件学院 Java语言程序设计课程设计课程设计报告 题 目 指导老师 2012 年 5 月 29 目录 第1章 小组成员介绍.3第2章 系统设计目的.3第3章 系统实现思路及设计.4第4章 系统调试运行.6第5章 课程设计心得.8第6章 附录.8第1章 小组成员介绍学号姓名比例分配 第2章 系统设计目的1)设计一个客
2、观题考试系统,实现以下功能:1.学生可以登录系统,选择考试科目,在规定时间内答完题目,退出; 2.教师可以登录系统,添加、修改、删除、查找试题题目,还可以查看考试科目分数结果、批量录入试题及更改密码等; 3.管理员可以登录系统,对科目、考试科目、任课教师信息和考试学生信息进行管理,如添加、查看、修改和删除等操作,还可以查看考试结果,批量录入科目、考试科目、任课教师和考生信息,更改密码等。2) 通过这次设计,旨在: 1.提高对java语言设计的掌握能力; 2.理论联系实际,进一步提高学生的软件开发技术; 3.使学生初步了解java项目的开发过程,培养团队意识; 3.培养学生分析、解决问题的能力。
3、 第3章 系统实现思路及详细设计一总体设计二1)学生模块2)教师模块3)数据库设计模块 利用数据库的查询,插入,更新简单易于管理数据的特性,我组决定使用数据库来存储数据,能很大程度上提高考试系统的性能,使其更稳定,简便。仔细考察题目要求,把要存储的内容提取出其属性,建成一些数库中的表,将java与数据库连接之后,在界面上的一些修改等操作会反应对表的操作,同时可以通过界面操作来动态创建和删除数据库中的表。4)管理模块 第4章 系统调试运行一、 登陆界面一、 功能 1)学生考试2)教师管理3)管理员 第5章课程设计心得经过四个星期的课程设计,我组顺利完成该课程设计。通过该课程设计,收获颇多。首先,
4、是我们加深了对Java语言的理论知识的理解;其次,让我们更加熟练的掌握了Java语言的设计能力并且有了实践经验;再次,在设计过程中,学到了老师没有在课堂上没有教授的知识;最后,加强了我们对Java语言的学习兴趣和好感。 第6章 附录1.登陆界面代码import java.awt.Font;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.event.ItemEvent;import java.awt.event.ItemListener;import javax.swin
5、g.ButtonGroup;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JPanel;import javax.swing.JPasswordField;import javax.swing.JRadioButton;import javax.swing.JTextField;public class main_login extends JPanel implements Item
6、Listener JFrame frame=new JFrame(考试系统); JLabel name; JLabel pas; JTextField tname; JPasswordField tpas; JRadioButton s_jbu; JRadioButton t_jbu; JRadioButton m_jbu; JButton login; JButton reset_button; int k=0; main_login() name=new JLabel(用户名); tname=new JTextField(20); pas=new JLabel(密码); tpas=new
7、JPasswordField(20); s_jbu=new JRadioButton(学生); t_jbu=new JRadioButton(教师); m_jbu=new JRadioButton(管理员); login=new JButton(登录); reset_button = new JButton(重填); this.setLayout(null); name.setBounds(50,50,150,60); tname.setBounds(170,50,200,50); pas.setBounds(50,160,150,60); tpas.setBounds(170,160,200
8、,50); s_jbu.setBounds(50,310,100,40); t_jbu.setBounds(170,310,100,40); m_jbu.setBounds(290,310,100,40); login.setBounds(410,310,100,40); /reset_button.setBounds(); Font fnt=new Font(Serief,Font.BOLD,20); name.setFont(fnt); pas.setFont(fnt); s_jbu.setFont(fnt); t_jbu.setFont(fnt); m_jbu.setFont(fnt);
9、 login.setFont(fnt); ButtonGroup group=new ButtonGroup(); group.add(s_jbu); group.add(t_jbu); group.add(m_jbu); this.add(name); this.add(tname); this.add(pas); this.add(tpas); this.add(s_jbu); this.add(t_jbu); this.add(m_jbu); this.add(login); this.add(reset_button); reset_button.addActionListener(n
10、ew ActionListener() public void actionPerformed(ActionEvent e) tname.setText(); tpas.setText(); ); s_jbu.addItemListener(this); t_jbu.addItemListener(this); m_jbu.addItemListener(this); login.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) String s=tname.getText();
11、String p=tpas.getText(); try if(k=1) if(new ResultSetDemo01().check(s, p,k) S1.login=s; new S1().diaplay(); tname.setText(); tpas.setText(); else JOptionPane.showMessageDialog(null, 用户名或密码错误); tname.setText(); tpas.setText(); else if(k=2) if(new ResultSetDemo01().check(s, p,k) T_new1.t_login=s; /Sys
12、tem.out.println(T_new1.t_login); new T_new1().diaplay(); tname.setText(); tpas.setText(); else JOptionPane.showMessageDialog(null, 用户名或密码错误); tname.setText(); tpas.setText(); else if(k=3) if(new ResultSetDemo01().check(s, p,k) M1.login=s; new M1().display(); tname.setText(); tpas.setText(); else JOp
13、tionPane.showMessageDialog(null, 用户名或密码错误); tname.setText(); tpas.setText(); catch (Exception ee) / TODO: handle exception ); public void itemStateChanged(ItemEvent e) if(e.getSource()=s_jbu) k=1; else if(e.getSource()=t_jbu) k=2; else if(e.getSource()=m_jbu) k=3; public static void main(String args
14、) JFrame frame=new JFrame(考试系统); frame.add(new main_login(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); frame.setSize(600,400); frame.setLocationRelativeTo(null);2.学生考试部分代码import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.sql.Date;i
15、mport javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JOptionPane;import javax.swing.JPanel;import javax.swing.JTextArea;import javax.swing.JTextField;import javax.swing.JLabel;public class S2 extends JPanel implements ActionListenerJTextField grade;JTextArea jtx;JButton jb1;JButton
16、 jb2;JTextField ans;JButton jb3;String ds;JLabel jl;JLabel jl1;int np=new int200;int p;int count;String myAns=new String1000;String trueAns=new String1000;int tscore=new int 1000;int myscore=0;int w;JButton end;S2()trynp= new get_test_number().readnumber(S1.choose);count=np.length;catch (Exception e
17、) / TODO: handle exceptiontryp=0;StringBuffer buf=new ClobDemo02().readcontent(npp); ds=new String(buf);catch (Exception e) / TODO: handle exceptiongrade=new JTextField();grade.setEditable(false);end = new JButton(交卷);jtx=new JTextArea(ds);jtx.setSize(400, 500);jtx.setEditable(false);jl=new JLabel(答
18、案:);/增加2jl1=new JLabel(分数:);/增加1jb1=new JButton(上一题);jb2=new JButton(下一题);jb3=new JButton(提交);/改一下位置ans=new JTextField(50);jtx.setLineWrap(true);this.setLayout(null);jl1.setBounds(400,100,50,30);/改动3grade.setBounds(440,100,50,30);jtx.setBounds(30,30,300,200);jl.setBounds(50,250,60,30);jb1.setBounds(
19、90,350,80,30);jb2.setBounds(195,350,80,30);ans.setBounds(100,250,80,30);jb3.setBounds(190,250,80,30);end.setBounds(410,180,80,30);jb1.addActionListener(this);jb2.addActionListener(this);jb3.addActionListener(this);end.addActionListener(this);this.add(jb1);this.add(jl);this.add(jl1);this.add(jb2);thi
20、s.add(ans);this.add(jb3);this.add(jtx);this.add(end);this.add(grade); void display() JFrame frame=new JFrame(答题页面); frame.setLocationRelativeTo(null); frame.add(this); frame.setVisible(true); frame.setSize(600, 500);/改动4public void actionPerformed(ActionEvent e) if(e.getSource()=jb1) if(p0) try p-;S
21、tringBuffer buf=new ClobDemo02().readcontent(npp); ds=new String(buf);jtx.setText(ds);catch (Exception ew) / TODO: handle exception else if(e.getSource()=jb2) p+=1; if(prt) ClobDemo04 da=new ClobDemo04(); ClobDemo03 db=new ClobDemo03();for(int i=0;icount;i+)trueAnsi=da .readanswer(npi);tscorei=db.re
22、adscore(npi);for(int i=0;icount;i+)System.out.println(trueAnsi);System.out.println(tscorei);myscore=0;for(int i=0;icount;i+)if(trueAnsi.equals(myAnsi)myscore+=tscorei;String sr=+myscore;grade.setText(sr);System.out.println(我的成绩:+myscore); String sd=new Read_S_name().readname(new Integer(S1.login); System.out.println(sd);new S_record().intsert_s_record(new Integer(S1.login), sd, myscore);/ else/ JOptionPane.showMessageDialog(null, 现在不能交卷);/ / catch (Exception er) / TODO: handle exception -