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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

工资系统代码JAVA版.docx

1、工资系统代码JAVA版工资系统代码/*系统欢迎界面*/import java.awt.FlowLayout;import java.awt.event.*; import javax.swing.*; SuppressWarnings(serial)class WagesSystem extends JFrame implements ActionListener JFrame frame = new JFrame(欢迎进入工资管理系统); JButton button1 = new JButton(进入系统); JButton button2 = new JButton(退出系统); Ima

2、geIcon im = new ImageIcon(1.jpg); JLabel a1 = new JLabel(im); void Create() JPanel pcontentPane = (JPanel) frame.getContentPane(); pcontentPane.add(a1); pcontentPane.setLayout(new FlowLayout(); pcontentPane.add(button1); pcontentPane.add(button2); pcontentPane.setVisible(true); button1.addActionList

3、ener(this); button2.addActionListener(this); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); public static void main(String args) WagesSystem dome = new WagesSystem(); dome.Create(); public void actionPerformed(ActionEven

4、t e) if (button1.equals(e.getSource() DL dl = new DL(); dl.create(); frame.dispose(); if (button2.equals(e.getSource() System.exit(0); /*登录界面*/import java.awt.HeadlessException;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.sql.Connection;import java.sql.DriverMan

5、ager;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JPasswordField;import javax.swing.JTextField;import .*;import java.sql.*;SuppressWarn

6、ings(serial)class DL extends JFrame implements ActionListener NetConn sql; Statement sqll; ResultSet rs; JFrame frame = new JFrame(职工/管理员登陆); JLabel label1 = new JLabel(用户名); JLabel label2 = new JLabel(密 码); JButton logonButton1 = new JButton(系统管理员登录); JButton logonButton2 = new JButton(教职工登录); JBut

7、ton logonButton3 = new JButton(财务管理员登录); JButton cancelButton = new JButton(退出); JTextField username = new JTextField(9); JPasswordField password = new JPasswordField(9); static String t1; static String t2; void create() frame.setLayout(null); label1.setBounds(60,20,50,20); frame.add(label1); userna

8、me.setBounds(130,20,150,20); frame.add(username); label2.setBounds(60,50,50,20); frame.add(label2); password.setBounds(130,50,150,20); frame.add(password); logonButton1.setBounds(100,90,150,20); frame.add(logonButton1); logonButton2.setBounds(100,120,150,20); frame.add(logonButton2); logonButton3.se

9、tBounds(100,150,150,20); frame.add(logonButton3); cancelButton.setBounds(100,180,150,20); frame.add(cancelButton); logonButton1.addActionListener(this); logonButton2.addActionListener(this); logonButton3.addActionListener(this); cancelButton.addActionListener(this); sql=new NetConn();/建立数据库连接 frame.

10、setSize(350,250); frame.setLocationRelativeTo(null); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); SuppressWarnings(deprecation) public void actionPerformed(ActionEvent e) t1 = username.getText(); t2 = password.getText(); /系统管理员登录 if(e.getSource()=logonButton1) if( us

11、ername.getText().equals(admin) = true & (password.getText().equals(admin) = true) JOptionPane.showMessageDialog(this, 登录成功!); xtgly a=new xtgly(); frame.dispose(); else JOptionPane.showMessageDialog(null, 输入用户名或密码错误!); /教职工登陆 if(e.getSource()=logonButton2) sqll=sql.connect(); try rs=sqll.executeQuer

12、y(SELECT * FROM user_teacher where name=+username.getText()+); String sname,spass; if(rs.next() sname=rs.getString(2); spass=rs.getString(3); if(password.getText().trim().equals(spass)&(username.getText().trim().equals(sname) JOptionPane.showMessageDialog(this, 登录成功!); Teacher_P a=new Teacher_P(); a

13、.creat(rs.getString(1); frame.dispose(); else JOptionPane.showMessageDialog(null, 输入用户名或密码错误!); else JOptionPane.showMessageDialog(null, 用户不存在!); catch (SQLException e2) / TODO 自动生成的 catch 块 e2.printStackTrace(); /财务登陆 if (e.getSource()=logonButton3) sqll=sql.connect(); try rs=sqll.executeQuery(SELE

14、CT * FROM user_cw where name=+username.getText()+); String sname,spass; if(rs.next() sname=rs.getString(2); spass=rs.getString(3); if(password.getText().trim().equals(spass)&(username.getText().trim().equals(sname) JOptionPane.showMessageDialog(this, 登录成功!); CW a=new CW(); a.create(rs.getString(1);

15、frame.dispose(); else JOptionPane.showMessageDialog(null, 输入用户名或密码错误!); else JOptionPane.showMessageDialog(null, 用户不存在!); catch (SQLException e2) / TODO 自动生成的 catch 块 e2.printStackTrace(); / 退出 if (cancelButton.equals(e.getSource() System.exit(0); /*数据库链接*/import java.sql.*;/数据库联接类public class NetCo

16、nn Connection con; Statement sql; public Statement connect() try /载入驱动程序字符串 Class.forName(com.microsoft.sqlserver.jdbc.SQLServerDriver); catch(ClassNotFoundException e1) try /通过JDBC URL得到Connetction对象 con=DriverManager.getConnection(jdbc:sqlserver:/localhost:1433;DatabaseName=gzxt,sa,123456); /通过Con

17、nection对象创建Statement对象 sql=con.createStatement(); catch(SQLException e2) return sql; /*系统管理员界面*/import java.awt.BorderLayout;import java.awt.Container;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Stateme

18、nt;import javax.swing.JButton;import javax.swing.JDialog;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JPasswordField;import javax.swing.JScrollPane;import javax.swing.JTabbedPane;import javax.swing.JTable;import javax.swing.JTextField;SuppressWarnings(serial)class xtgly ext

19、ends JFrame implements ActionListener JFrame frame = new JFrame(教职工信息查询及密码修改); Object a,b; Object colname=工号,姓名,密码; NetConn sql; Statement sqll; ResultSet rs; JTable table,table2; JButton Button1 = new JButton(添加教职工); JButton Button2 = new JButton(添加财务管理员); JButton Button3 = new JButton(修改密码); JButt

20、on Button4 = new JButton(刷新); JTabbedPane tab = new JTabbedPane(JTabbedPane.TOP); int i=0; xtgly() frame.setLayout(null); sql=new NetConn(); sqll=sql.connect(); a=new Object303; b=new Object303; try String temp=select * from user_cw; rs=sqll.executeQuery(temp); while(rs.next() ai0=rs.getString(1); a

21、i1=rs.getString(2); ai2=rs.getString(3); i+; i=0; String temp2=select * from user_teacher; rs=sqll.executeQuery(temp2); while(rs.next() bi0=rs.getString(1); bi1=rs.getString(2); bi2=rs.getString(3); i+; catch (SQLException e) / TODO 自动生成的 catch 块 e.printStackTrace(); table=new JTable(a,colname); tab

22、le.setEnabled(false); table2=new JTable(b,colname); table2.setEnabled(false); JScrollPane JSP= new JScrollPane(table); JScrollPane JSP2= new JScrollPane(table2); tab.add(JSP,财务管理员); tab.add(JSP2,教职工); tab.setBounds(0,0,350,180); Button1.setBounds(1,185,110,20); Button1.addActionListener(this); Butto

23、n2.setBounds(115,185,125,20); Button2.addActionListener(this); Button3.setBounds(245,185,89,20); Button3.addActionListener(this); Button4.setBounds(260,0,75,20); Button4.addActionListener(this); frame.add(Button1); frame.add(Button2); frame.add(Button3); frame.add(Button4); frame.add(tab); frame.set

24、Size(350,250); frame.setLocationRelativeTo(null); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); public void actionPerformed(ActionEvent e) /添加教职工 if(e.getSource()=Button1) Add_teacher add1=new Add_teacher(); /添加财务管理员 if(e.getSource()=Button2) Add_cw add2=new Add_cw();

25、 /修改密码 if(e.getSource()=Button3) Change_mima change=new Change_mima(); if(e.getSource()=Button4) i=0; try String temp=select * from user_cw; rs=sqll.executeQuery(temp); while(rs.next() ai0=rs.getString(1); ai1=rs.getString(2); ai2=rs.getString(3); i+; i=0; String temp2=select * from user_teacher; rs

26、=sqll.executeQuery(temp2); while(rs.next() bi0=rs.getString(1); bi1=rs.getString(2); bi2=rs.getString(3); i+; catch (SQLException e1) / TODO 自动生成的 catch 块 e1.printStackTrace(); table.removeAll(); table2.removeAll(); table=new JTable(a,colname); table.setEnabled(false); table2=new JTable(b,colname);

27、table2.setEnabled(false); tab.updateUI(); /*添加财务管理人员*/import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;import javax.swing.JButton;import javax.swing.JDialog;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JPasswordField;import javax.swing.JTextField;

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

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