学生学籍管理系统含java源代码.doc
《学生学籍管理系统含java源代码.doc》由会员分享,可在线阅读,更多相关《学生学籍管理系统含java源代码.doc(21页珍藏版)》请在课桌文档上搜索。
1、word学生学籍管理详细设计 学号:_ 某某:_ 班级:_1、 设计题目:学生学籍管理二:设计内容: 设计GUI学生学籍管理界面,用户可以参加学生信息,并对根本信息进展修改,添加,查询,删除。三:设计要求: 进展简单的学生信息管理。四:总体设计 (1)登陆界面的设计 2主窗体的设计 3添加学生信息窗体 4查询学生信息窗体 5修改学生信息窗体 6删除学生信息窗体 7)事件响应的处理五:具体设计(1) 程序结构的说明:A. 入口程序:student.java;B. 登陆界面程序:mainframe.java;C. 主窗体程序:interfac.java;D. 添加信息窗口程序:tj.java;E.
2、 修改信息窗口程序:xg.java;F. 查询信息窗口程序:cx.java;G. 删除信息窗口程序:sc.java;H. 程序数据连接:DatabaseConn.java;(2) 程序代码与分析说明A.程序源代码已提交B.Student.java是程序的入口。使登录窗口位于窗口中间,并且不可改变窗口大小。C.mainframe.java是程序的登陆窗体。输入用户名和密码用户名和密码在数据库的password表中点击“进入系统,然后登陆界面消失;出现要操作的界面屏幕左上角。D.tj.java是添加信息界面。添加根本信息后,点击“添加信息按钮,将信息参加xinxi表中。E.xg.java是修改信息
3、界面。输入要修改的学号或某某两者数其一或全部输入,并输入所有信息,点击“修改信息按钮如果数据库中不存在此学号,如此弹出对话框“无此学生信息,假如有如此修改。F.sc.java是删除信息界面。输入要删除的学生的学号,点击“删除信息按钮,弹出确认删除对话框,即可删除该生信息。G.cx.java是查询信息界面。输入要查询的学生学号,点击“信息查询按钮,在相应的文本区里显示查询的信息。H:源代码/student.java:程序的入口。初始化界面,使主界面位于屏幕中间,且用户不能改变大小/功能:完成程序的执行顺序import javax.swing.UIManager;import java.awt.*
4、;import java.sql.*;/import screenpublic class studentboolean packFrame=false;/JFrame frame=new JFrame();public student()mainframe frame=new mainframe();if(packFrame)frame.pack();else frame.validate();Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();Dimension frameSize=frame.getSize()
5、;if(frameSize.heightscreenSize.height)frameSize.height=screenSize.height;if(frameSize.widthscreenSize.width)frameSize.width=screenSize.width;frame.setLocation(screenSize.width-frameSize.width)/2,(screenSize.height-frameSize.height)/2);frame.setVisible(true);public static void main(String args)tryUIM
6、anager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName();catch(Exception e)e.printStackTrace();new student();/数据库连接/package sql.database;import java.sql.*;public class DatabaseConnprivate static String user=;private static String password=;private Connection conn=null;private Statement stmt=n
7、ull;private ResultSet rs=null;static tryClass.forName(sun.jdbc.odbc.JdbcOdbcDriver);/加载驱动 catch(ClassNotFoundException e)/创建数据库连接对象public Connection getConnection()tryconn=DriverManager.getConnection(jdbc:odbc:stu,user,password);return conn;catch(SQLException e)return null;public Statement createSta
8、t()tryconn=getConnection();stmt=conn.createStatement();return stmt;catch(SQLException e)return null;public ResultSet getRs(String sql) try conn=getConnection();/. stmt=createStat(); rs=stmt.executeQuery(sql); return rs; catch(SQLException e) return null; public void close() try if(rs!=null) rs.close
9、(); if(stmt!=null) stmt.close(); if(conn!=null) conn.close(); catch(SQLException ex) ex.printStackTrace(); import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.sql.*;public class mainframe extends JFrame implements ActionListenerstatic mainframe s;static JPanel pan=new JPanel()
10、;static JLabel label1 = new JLabel(用 户); static JLabel label2 = new JLabel(密 码); static JTextField textField1 = new JTextField(); static JPasswordField password = new JPasswordField(); static utton button1 = new utton(进入系统); static JRadioButton radioButton1=new JRadioButton(管理员,true);/“管理员初始状态被选中 st
11、atic JRadioButton radioButton2=new JRadioButton(学生); static JRadioButton radioButton3=new JRadioButton(教师); ButtonGroup buttonGroup=new ButtonGroup(); public mainframe()JLabel label=new JLabel(new ImageIcon(图片44.jpg);label.setSize(400,400);pan.add(label);pan.setLayout(null);pan.setSize(400,400);this
12、.setTitle(学籍管理系统);this.setSize(400,400);this.setLayout(null);label1.setBounds(100,25,49,20);textField1.setBounds(155,24,120,20);label2.setBounds(100,62,49,20);password.setBounds(155,61,120,20);button1.setBounds(150,200,101,22); radioButton1.setBounds(105,120,80,20); radioButton2.setBounds(180,120,60
13、,20);radioButton3.setBounds(240,120,60,20);button1.addActionListener(this);buttonGroup.add(radioButton1); buttonGroup.add(radioButton2);buttonGroup.add(radioButton3);this.add(radioButton1);this.add(radioButton2);this.add(radioButton3);this.add(label1);this.add(label2);this.add(textField1);this.add(p
14、assword);this.add(button1);this.add(pan);this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);this.setVisible(true); public static void main(String args) new mainframe(); public void actionPerformed(ActionEvent e) if(radioButton1.isSelected()/管理员 if(textField1.getText().equals(syc) & password.getText
15、().equals(123)interfac b=new interfac();this.dispose();/JOptionPane.showMessageDialog(null,登陆成功);else if(.equals(textField1.getText() | .equals(password.getText() )JOptionPane.showMessageDialog(null,用户名或密码不能为空);else JOptionPane.showMessageDialog(null,用户名或密码输入有误);if(radioButton2.isSelected()/学生 tryCl
16、ass.forName(sun.jdbc.odbc.JdbcOdbcDriver);catch (ClassNotFoundException ce)JOptionPane.showMessageDialog(s,ce.getMessage();tryConnection con = DriverManager.getConnection(jdbc:odbc:stu,sa,);Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery(select * from password where 用户名 = +t
17、extField1.getText()+ and 密码 = +password.getText()+); if(textField1.getText().equals()|password.getText().equals() JOptionPane.showMessageDialog(this,用户名或密码不可为空!); else if(rs.next() new interfac(); else JOptionPane.showMessageDialog(this,您的输入有误); /stmt.close();catch (SQLException se)JOptionPane.showM
18、essageDialog(s,se.getMessage();import java.awt.*;import java.awt.event.*;import javax.swing.*;public class interfac extends JFrame implements ActionListenerstatic JMenuBar jMenuBar = new JMenuBar();/菜单条 static JMenu jMenuFile = new JMenu(文件);/菜单项 static JMenu jMenuExit = new JMenu(退出); static JMenuI
19、tem jMenuItem1 = new JMenuItem(添加信息);/菜单子项 static JMenuItem jMenuItem2 = new JMenuItem(修改信息); static JMenuItem jMenuItem3 = new JMenuItem(信息查询); static JMenuItem jMenuItem4 = new JMenuItem(删除信息); static JLabel label3 = new JLabel(请选择操作项); static JLabel label4 = new JLabel(学籍管理系统); static utton butto
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 学生 学籍 管理 系统 java 源代码
![提示](https://www.desk33.com/images/bang_tan.gif)
链接地址:https://www.desk33.com/p-9966.html