java考勤管理系统数据库实现(共11页).doc
《java考勤管理系统数据库实现(共11页).doc》由会员分享,可在线阅读,更多相关《java考勤管理系统数据库实现(共11页).doc(11页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上4.2设计代码Java源程序:import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.awt.*;import java.sql.*;import java.lang.*; import java.util.*; import javax.swing.table.*;import java.math.*; class DB_LS implements ActionListenerJFrame frame=new JFrame(欢迎进入LS工资管理系统);JLabel labe
2、l=new JLabel(09网络2_54_李胜,JLabel.CENTER);JButton button1=new JButton(进入系统);JButton button2=new JButton(退出系统);ImageIcon im=new ImageIcon(1.jpg); JLabel a1=new JLabel(im);void Create()JPanel pcontentPane=(JPanel)frame.getContentPane();JPanel pcontentPane1=new JPanel();pcontentPane.add(label);pcontentPa
3、ne.setLayout(new FlowLayout();pcontentPane.add(button1);pcontentPane.add(button2);pcontentPane.add(new Label( );pcontentPane.add(a1);pcontentPane.setBackground(Color.green);pcontentPane.setVisible(true);button1.addActionListener(this); button2.addActionListener(this);frame.setDefaultCloseOperation(J
4、Frame.EXIT_ON_CLOSE);frame.pack();frame.setBounds(200,100,550,600);frame.setVisible(true);public static void main(String args)DB_LS dome=new DB_LS();dome.Create(); public void actionPerformed(ActionEvent e) if(button1.equals(e.getSource() DL dl=new DL(); dl.create(); if(button2.equals(e.getSource()/
5、退出System.exit(0); class DL implements ActionListenerJFrame frame=new JFrame(职工/管理员登陆);JLabel label1=new JLabel(用户名);JLabel label2=new JLabel(密码);JButton logonButton1=new JButton(管理员登录);JButton logonButton2=new JButton(职工登录);JButton cancelButton=new JButton(退出);JTextField t1=new JTextField(0);JTextFi
6、eld t2=new JTextField(0);ImageIcon im=new ImageIcon(2.jpg); JLabel a2=new JLabel(im);JTextField username=new JTextField(9);JPasswordField password=new JPasswordField(9);void create()JPanel p=(JPanel)frame.getContentPane();JPanel p1=new JPanel();p.setLayout(new FlowLayout();p.add(label1);p.setSize(5,
7、5);p.setLocation(4,8);p.add(username);p.setSize(100,200);p.setLocation(800,800);p.add(label2);p.setSize(50,20);p.setLocation(40,80);p.add(password);p.setSize(100,20);p.setLocation(80,120);p.add(logonButton1);p.add(new JLabel( );p.add(logonButton2);p.add(new JLabel( );p.add(cancelButton);p.add(new JL
8、abel( );p.add(a2);p.add(t1);p.add(t2);p.setBackground(Color.blue);p.setVisible(true);logonButton1.addActionListener(this);logonButton2.addActionListener(this); cancelButton.addActionListener(this); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);frame.pack(); frame.setBounds(200,100,750,550); f
9、rame.setVisible(true);public void actionPerformed(ActionEvent e) if(logonButton1.equals(e.getSource()&(username.getText().equals(123)=true)&(password.getText().equals(123)=true)GZGLZJM gz=new GZGLZJM();gz.create();elseJOptionPane.showMessageDialog(null,对不起,你输入的密码错误!);if(logonButton2.equals(e.getSour
10、ce()&(username.getText().equals(t1.getText()=true)&(password.getText().equals(t2.getText()=true)XK xk=new XK();xk.create(); Connection con; Statement sql; ResultSet rs; Vector vector=new Vector(); try Class.forName(sun.jdbc.odbc.JdbcOdbcDriver); catch (ClassNotFoundException e1) System.out.println(
11、+ e1);try con = DriverManager.getConnection(jdbc:odbc:123, , );sql = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY); sql.executeQuery(SELECT Gno,mm FROM Y WHERE Gno=+t1.getText() +AND mm=+t2.getText();catch (SQLException e1) System.out.println(e1); if(cancelButton.eq
12、uals(e.getSource()System.exit(0); class GZGLZJM extends JFrame implements ActionListener JFrame f=new JFrame(工资管理系统); JButton b1=new JButton(津贴管理); JButton b2=new JButton(总查询); JButton b3=new JButton(工资管理); JButton b4=new JButton(后勤管理); JButton b6=new JButton(员工个人信息管理); JButton b5=new JButton(返回); I
13、mageIcon im=new ImageIcon(3.jpg); JLabel a3=new JLabel(im); void create() JPanel p=(JPanel)f.getContentPane(); JPanel p1=new JPanel(); p.setLayout(new FlowLayout(); p.add(b1); p.add(new JLabel( ); p.add(b6); p.add(new JLabel( ); p.add(b3); p.add(new JLabel( ); p.add(b4); p.add(new JLabel( ); p.add(b
14、2); p.add(new JLabel( ); p.add(b5); p.add(a3); p.setBackground(Color.red); p.setVisible(true); b1.addActionListener(this); b2.addActionListener(this); b3.addActionListener(this); b4.addActionListener(this); b5.addActionListener(this); b6.addActionListener(this); f.setBounds(200,100,800,600); f.setVi
15、sible(true); public void actionPerformed(ActionEvent e) if(b5.equals(e.getSource()/返回 DL d=new DL(); f.dispose(); if(b1.equals(e.getSource()/津贴管理 JTGL jt=new JTGL(); jt.create(); if(b6.equals(e.getSource()/员工个人信息管理 YGGL yg=new YGGL(); yg.create(); if(b2.equals(e.getSource()/查询 XK xk=new XK(); xk.cre
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- java 考勤 管理 系统 数据库 实现 11
限制150内