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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

学生学籍管理系统含java源代码1文档格式.docx

1、cx.java;G.删除信息窗口程序:sc.java;H.程序数据连接:DatabaseConn.java;(2)程序代码及分析说明A.程序源代码(已提交)B.Student.java是程序的入口。使登录窗口位于窗口中间,并且不可改变窗口大小。C.mainframe.java是程序的登陆窗体。输入用户名和密码(用户名和密码在数据库的password表中)点击“进入系统”,然后登陆界面消失;出现要操作的界面(屏幕左上角)。D.tj.java是添加信息界面。添加基本信息后,点击“添加信息”按钮,将信息加入xinxi表中。E.xg.java是修改信息界面。输入要修改的学号或姓名(两者数其一或全部输入

2、),并输入所有信息,点击“修改信息”按钮(如果数据库中不存在此学号,则弹出对话框“无此学生信息”),若有则修改。F.sc.java是删除信息界面。输入要删除的学生的学号,点击“删除信息”按钮,弹出确认删除对话框,即可删除该生信息。G.cx.java是查询信息界面。输入要查询的学生学号,点击“信息查询”按钮,在相应的文本区里显示查询的信息。H:源代码/student.java:程序的入口。初始化界面,使主界面位于屏幕中间,且用户不能改变大小/功能:完成程序的执行顺序import javax.swing.UIManager;import java.awt.*;import java.sql.*;/

3、import screenpublic class student boolean 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(); if(frameS

4、ize.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) try UIMan

5、ager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName(); catch(Exception e) e.printStackTrace(); new student(); /数据库连接/package sql.database;public class DatabaseConn private static String user=; private static String password= private Connection conn=null; private Statement stmt=null; private

6、ResultSet rs=null; static tryClass.forName(sun.jdbc.odbc.JdbcOdbcDriver);/加载驱动 catch(ClassNotFoundException e) /创建数据库连接对象 public Connection getConnection() conn=DriverManager.getConnection(jdbc:odbc:stu,user,password); return conn; catch(SQLException e) return null; public Statement createStat() try

7、 conn=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

8、(); if(stmt! stmt.close(); if(conn! conn.close(); catch(SQLException ex) ex.printStackTrace(); /mainframe.javaimport java.awt.event.*;import javax.swing.*;public class mainframe extends JFrame implements ActionListener static mainframe s; static JPanel pan=new JPanel(); static JLabel label1 = new JL

9、abel(用 户 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);/“管理员”初始状态被选中 static JRadioButton radioButton2=

10、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.setTitle(学籍管理系统 this.setSize

11、(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,20); radioButton3.setBo

12、unds(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(password); thi

13、s.add(button1); this.add(pan); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setVisible(true); new mainframe(); public void actionPerformed(ActionEvent e) if(radioButton1.isSelected()/管理员 if(textField1.getText().equals(syc) & password.getText().equals(123) interfac b=new interfac(); this

14、.dispose(); /JOptionPane.showMessageDialog(null,登陆成功 else if(.equals(textField1.getText() | .equals(password.getText() ) JOptionPane.showMessageDialog(null,用户名或密码不能为空 else JOptionPane.showMessageDialog(null,用户名或密码输入有误if(radioButton2.isSelected()/学生 Class.forName( catch (ClassNotFoundException ce) JO

15、ptionPane.showMessageDialog(s,ce.getMessage(); try Connection con = DriverManager.getConnection(,sa Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery(select * from password where 用户名 = +textField1.getText()+ and 密码 = +password.getText()+ if(textField1.getText().equals()|passwo

16、rd.getText().equals() JOptionPane.showMessageDialog(this,用户名或密码不可为空! else if(rs.next() new interfac(); else JOptionPane.showMessageDialog(this,您的输入有误 /stmt.close(); catch (SQLException se) JOptionPane.showMessageDialog(s,se.getMessage();/interface.javapublic class interfac extends JFrame implements

17、ActionListener static JMenuBar jMenuBar = new JMenuBar();/菜单条 static JMenu jMenuFile = new JMenu(文件/菜单项 static JMenu jMenuExit = new JMenu(退出 static JMenuItem jMenuItem1 = new JMenuItem(添加信息/菜单子项 static JMenuItem jMenuItem2 = new JMenuItem(修改信息 static JMenuItem jMenuItem3 = new JMenuItem(信息查询 static

18、 JMenuItem jMenuItem4 = new JMenuItem(删除信息 static JLabel label3 = new JLabel(请选择操作项 static JLabel label4 = new JLabel( static JButton button2 = new JButton( static JButton button3 = new JButton( static JButton button4 = new JButton( static JButton button5 = new JButton( public interfac() label3.setB

19、ounds(158,92,98,33); label3.setFont(new Font(Dialog,Font.PLAIN,15); label4.setFont(new Font(,Font.BOLD,20); label4.setBounds(157,37,280,40); button2.setBounds(74,136,97,33); button3.setBounds(226,136,97,33); button4.setBounds(74,185,97,33); button5.setBounds(226,185,97,33); this.add(button2); this.a

20、dd(button3); this.add(button4); this.add(button5); this.add(label3); this.add(label4); setJMenuBar(jMenuBar); jMenuFile.add(jMenuItem1);/”文件“菜单项中加入子菜单 jMenuFile.add(jMenuItem2); jMenuFile.add(jMenuItem3); jMenuFile.add(jMenuItem4); jMenuBar.add(jMenuFile);/将菜单项加入菜单条 jMenuBar.add(jMenuExit); button2.

21、addActionListener(this);/本窗口向按钮事件源注册 button3.addActionListener(this); button4.addActionListener(this); button5.addActionListener(this); jMenuItem1.addActionListener(this);/本窗口菜单子项注册 jMenuItem2.addActionListener(this); jMenuItem3.addActionListener(this); jMenuItem4.addActionListener(this); jMenuExit.

22、addActionListener(this); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setVisible(true); interfac a=new interfac(); public void actionPerformed(ActionEvent e) /按钮事件的处理 if(e.getSource()=jMenuExit) System.exit(0); else if(e.getSource()=jMenuItem1|e.getSource()=button2) try tj a=new tj(); c

23、atch(Exception ee) else if(e.getSource()=jMenuItem2|e.getSource()=button3) try xg a=new xg(); catch(Exception ed) else if(e.getSource()=jMenuItem3|e.getSource()=button4) cx a=new cx(); catch(Exception ec) else if(e.getSource()=jMenuItem4|e.getSource()=button5) sc a=new sc(); catch(Exception es)/tj.j

24、ava 添加界面public class tj extends JFrame implements ActionListener static tj s;学号: static JTextField textField1 = new JTextField(姓名: static JTextField textField2 = new JTextField(性别: static JTextField textField7=new JTextField(出生日期: 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(系别: st

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1