学生学籍管理详细设计学号:___________姓名:___________班级:___________一、设计题目:学生学籍管理二:设计内容:设计GUI 学生学籍管理界面,用户可以加入学生信息,并对基本信息进行修改,添加,查询,删除。
三:设计要求:进行简单的学生信息管理。
四:总体设计(1)登陆界面的设计(2)主窗体的设计(3)添加学生信息窗体(4)查询学生信息窗体(5)修改学生信息窗体(6)删除学生信息窗体(7)事件响应的处理五:具体设计(1)程序结构的说明:A. 入口程序:;B. 登陆界面程序:;C. 主窗体程序:;D. 添加信息窗口程序:;E. 修改信息窗口程序:;F. 查询信息窗口程序:;G. 删除信息窗口程序:;H. 程序数据连接:;(2)程序代码及分析说明 A.程序源代码(已提交) 是程序的入口。
使登录窗口位于窗口中间,并且不可改变窗口大小。
是程序的登陆窗体。
输入用户名和密码(用户名和密码在数据库的password 表中)点击“进入系统” ,然后登陆界面消失;出现要操作的界面(屏幕左上角) 。
是添加信息界面。
添加基本信息后,点击“添加信息”按钮,将信息加入xinxi 表中。
是修改信息界面。
输入要修改的学号或姓名(两者数其一或全部输入) ,并输入所有信息,点击“修改信息”按钮(如果数据库中不存在此学号,则弹出对话框“无此学生信息”),若有则修改。
是删除信息界面。
输入要删除的学生的学号,点击“删除信息”按钮,弹出确认删除对话框,即可删除该生信息。
是查询信息界面。
输入要查询的学生学号,点击“信息查询”按钮,在相应的文本区里显示查询的信息。
H:源代码import .*; etScreenSize();Dimension frameSize=();if> {} if> {}( (true);}public static void main(String[] args){try{ ()); } catch(Exception e) {();}new student();public class DatabaseConn{private static String user="";private static String password="";private Connection conn=null;private Statement stmt=null;private ResultSet rs=null;static{ try{("");.stmt=createStat(); rs=(sql); return rs;}catch(SQLException e){ return null;}} public void close(){try{ if(rs!=null) ();if(stmt!=null)(); if(conn!=null)();}catch(SQLException ex){();}}}import .*;import .*;public class mainframe extends JFrame implements ActionListener {static mainframe s;static JPanel pan=new JPanel();static JLabel label1 = new JLabel用(" 户");static JLabel label2 = new JLabel密(" 码");static JTextField textField1 = new JTextField();static JPasswordField password = new JPasswordField();static JButton button1 = new JButton("进入系统");static JRadioButton radioButton1=new JRadioButton("管理员",true);quals("syc") && ().equals("123")){interfac b=new interfac();();quals()) || "".equals()) ){(null," 用户名或密码不能为空");}else{(null," 用户名或密码输入有误");}}if())quals("")||().equals("")){ (this,"用户名或密码不可为空!");}else if()){ new interfac();}else{(this," 您的输入有误");}import .*;public class interfac extends JFrame implements ActionListener {static JMenuBar jMenuBar = new JMenuBar();;import .*;import .*;public class tj extends JFrame implements ActionListener {static tj s;static JLabel label1 = new JLabel学(" 号:");static JTextField textField1 = new JTextField("");static JLabel label2 = new JLabel(姓" 名:");static JTextField textField2 = new JTextField(""); static JLabel label3 = newJLabel(性" 别:"); static JTextField textField7=new JTextField(""); static JLabellabel4 = new JLabel(出" 生日期:"); static JTextField textField3 = newJTextField(""); static JLabel label5 = new JLabel(政" 治面貌:"); static JTextField textField8=new JTextField(""); static JLabel label6 = new JLabel籍(" 贯");static JTextField textField4 = new JTextField(""); static JLabel label7 = newJLabel(系" 别:");static JTextField textField9 = new JTextField(""); static JLabel label8 = newJLabel专(" 业:");static JTextField textField5 = new JTextField(""); static JButton button1 = new JButton("增加");public tj(){(" 增加学生信息");(null);(400,400) ; (30, 11, 51, 33); (86, 16, 74, 22); (162, 11, 51, 33); (192, 16, 44,22); (241, 11, 70, 33); (275, 15, 50, 25); (31, 53, 55, 33); (86, 58, 74, 22); (241,53, 70, 33); (296, 57, 72, 25); (163, 53, 26, 33); (191, 58, 44, 22); (30, 94, 50,33);(86,94,74,22) ; (163, 94, 51, 33); (190, 99, 178, 22);(25,241,80,33) ; (this);(label1);(label2);(label3);(label4);(label5);(label6);(label7);(label8);(textField1); (textField2); (textField3); (textField4); (textField5); (textField7);(textField8); (textField9); (button1);(true);}public static void main(String[] args) throws Exception { tj a= new tj();}public void actionPerformed(ActionEvent e);import .*;import .*;public class xg extends JFrame implements ActionListener {static JLabel label1 = new JLabel学(" 号:");static JTextField textField1 = new JTextField("");static JLabel label2 = new JLabel(姓" 名:");static JTextField textField2 = new JTextField("");static JLabel label3 = new JLabel(性" 别:");static JTextField textField7=new JTextField("");static JLabel label4 = new JLabel(出" 生日期:"); static JTextField textField3 = new JTextField("");static JLabel label5 = new JLabel(政" 治面貌:");static JTextField textField8=new JTextField("");static JLabel label6 = new JLabel籍(" 贯");static JTextField textField4 = new JTextField("");static JLabel label7 = new JLabel(系" 别:");static JTextField textField9 = new JTextField(""); static JLabel label8 = new JLabel专(" 业:");static JTextField textField5 = new JTextField(""); static JButton button2=new JButton("修改"); public xg(){(" 修改学生信息");(null);(400,400) ;(30, 11, 51, 33);(86, 16, 74, 22);(162, 11, 51, 33);(192, 16, 44, 22);(241, 11, 70, 33);(275, 15, 50, 25);(31, 53, 55, 33);(86, 58, 74, 22);(241, 53, 70, 33);(296, 57, 72, 25);(163, 53, 26, 33);(191, 58, 44, 22);(30, 94, 50, 33);(86,94,74,22) ;(163, 94, 51, 33);(190, 99, 178, 22);(115,241,80,33) ;(this);(label1);(label2);(label4); (label5); (label6); (label7); (label8); (textField1); (textField2); (textField3); (textField4); (textField5); (textField7); (textField8); (textField9); (button2);(true);}public static void main(String[] args) throws Exception{ xg a=new xg();}public void actionPerformed(ActionEvent e)rim().equals("")){(this,"学号不可为空!");}else if()) {String updateSql="update xinxi set 学号='"+()+"', 姓名='"+()+"',性别='"+()+"',出生日期='"+()+"', 政治面貌='"+()+"',籍贯='"+()+"',系别='"+()+"',专业='"+()+ "'";try{(updateSql);}catch(SQLException se) {(null,"修改成功");}}}catch(SQLException se){(s,());}}import .*;import .*;public class sc extends JFrame implements ActionListener {static sc s;static JLabel label1 = new JLabel学(" 号:");static JTextField textField1 = new JTextField("");static JLabel label2 = new JLabel(姓" 名:");static JTextField textField2 = new JTextField("");static JLabel label3 = new JLabel(性" 别:");static JTextField textField7=new JTextField("");static JLabel label4 = new JLabel(出" 生日期:"); static JTextField textField3 = new JTextField("");static JLabel label5 = new JLabel(政" 治面貌:");static JTextField textField8=new JTextField("");static JLabel label6 = new JLabel籍(" 贯");static JTextField textField4 = new JTextField("");static JLabel label7 = new JLabel(系" 别:");static JTextField textField9 = new JTextField("");static JLabel label8 = new JLabel专(" 业:");static JTextField textField5 = new JTextField(""); static JButton button4=new JButton("删除");public sc() throws Exception{(" 删除学生信息");(null);(400,400) ;(30, 11, 51, 33);(86, 16, 74, 22);(162, 11, 51, 33);(192, 16, 44, 22);(241, 11, 70, 33);(275, 15, 50, 25);(31, 53, 55, 33);(86, 58, 74, 22);(241, 53, 70, 33);(296, 57, 72, 25);(163, 53, 26, 33);(191, 58, 44, 22);(30, 94, 50, 33);(86,94,74,22) ;(163, 94, 51, 33);(190, 99, 178, 22);(295,241,80,33) ;(this);(label1);(label2);(label3);(label4);(label5);(label6);(label7);(label8);(textField1);(textField2);(textField3);(textField4);(textField5);(textField7);(textField8);(textField9);(button4);(true);}public static void main(String[] args) throws Exception{sc a= new sc();}public void actionPerformed(ActionEvent e)rim().equals("")){(this,"学号不可为空!");}else if()){(null," 确定要删除该信息嘛\n 删除的信息将不能恢复,继续","删除确定",;;import .*;import .*;public class cx extends JFrame implements ActionListener{static cx s;static JLabel label1 = new JLabel学(" 号:"); static JTextField textField1 = new JTextField(""); static JLabel label2 = new JLabel(姓" 名:");static JTextField textField2 = new JTextField(""); static JLabel label3 = new JLabel(性" 别:");static JTextField textField7=new JTextField(""); static JLabel label4 = new JLabel(出" 生日期:"); static JTextField textField3 = new JTextField(""); static JLabel label5 = new JLabel(政" 治面貌:"); static JTextField textField8=new JTextField(""); static JLabel label6 = new JLabel籍(" 贯");static JTextField textField4 = new JTextField(""); static JLabel label7 = new JLabel(系" 别:");static JTextField textField9 = new JTextField(""); static JLabel label8 = new JLabel专(" 业:");static JTextField textField5 = new JTextField(""); static JButton button3=new JButton("查询");public cx() throws Exception{(" 查询学生信息");(null);(400,400) ;(30, 11, 51, 33);(86, 16, 74, 22);(162, 11, 51, 33);(192, 16, 44, 22);(241, 11, 70, 33);(275, 15, 50, 25);(31, 53, 55, 33);(86, 58, 74, 22);(241, 53, 70, 33);(296, 57, 72, 25);(163, 53, 26, 33); (191,58, 44, 22);(30, 94, 50, 33);(86,94,74,22) ;(163, 94, 51, 33); (190, 99, 178, 22);(205,241,80,33) ;(this);(label1);(label2);(label3);(label4);(label5);(label6);(label7);(label8);(textField1); (textField2); (textField3); (textField4); (textField5); (textField7);(textField8); (textField9); (button3);(true);}public static void main(String[] args) throws Exception {cx a=new cx();}public void actionPerformed(ActionEvent e){ if()==button3){try{("");}catch (ClassNotFoundException ce){(s,());}try{Connection con = ("jdbc:odbc:stu","sa",""); Statement stmt = ();ResultSet rs=("select * from xinxi where 学号='"+()+"'");if().trim().equals("")){(this,"学号不可为空!");else if()){ ("姓名")); ("性别")); ("出生日期")); ("政治面貌")); ("籍贯"));("系别")); ("专业"));}else{(this,"无此记录!!!");}}catch (SQLException se){(s,());}}}}I. 运行说明在DOS 窗口输入javacjava student 运行程序。