java考勤管理系统数据库实现Word文档下载推荐.docx

上传人:b****3 文档编号:17233168 上传时间:2022-11-29 格式:DOCX 页数:15 大小:17.63KB
下载 相关 举报
java考勤管理系统数据库实现Word文档下载推荐.docx_第1页
第1页 / 共15页
java考勤管理系统数据库实现Word文档下载推荐.docx_第2页
第2页 / 共15页
java考勤管理系统数据库实现Word文档下载推荐.docx_第3页
第3页 / 共15页
java考勤管理系统数据库实现Word文档下载推荐.docx_第4页
第4页 / 共15页
java考勤管理系统数据库实现Word文档下载推荐.docx_第5页
第5页 / 共15页
点击查看更多>>
下载资源
资源描述

java考勤管理系统数据库实现Word文档下载推荐.docx

《java考勤管理系统数据库实现Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《java考勤管理系统数据库实现Word文档下载推荐.docx(15页珍藏版)》请在冰豆网上搜索。

java考勤管理系统数据库实现Word文档下载推荐.docx

pcontentPane.add(button1);

pcontentPane.add(button2);

pcontentPane.add(newLabel("

"

));

pcontentPane.add(a1);

pcontentPane.setBackground(Color.green);

pcontentPane.setVisible(true);

button1.addActionListener(this);

button2.addActionListener(this);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.pack();

frame.setBounds(200,100,550,600);

frame.setVisible(true);

}

publicstaticvoidmain(String[]args){

DB_LSdome=newDB_LS();

dome.Create();

}

publicvoidactionPerformed(ActionEvente){

if(button1.equals(e.getSource())){

DLdl=newDL();

dl.create();

}

if(button2.equals(e.getSource())){//退出

System.exit(0);

}

}

 

classDLimplementsActionListener{

职工/管理员登陆"

JLabellabel1=newJLabel("

用户名"

JLabellabel2=newJLabel("

密码"

JButtonlogonButton1=newJButton("

管理员登录"

JButtonlogonButton2=newJButton("

职工登录"

JButtoncancelButton=newJButton("

退出"

JTextFieldt1=newJTextField(0);

JTextFieldt2=newJTextField(0);

2.jpg"

JLabela2=newJLabel(im);

JTextFieldusername=newJTextField(9);

JPasswordFieldpassword=newJPasswordField(9);

voidcreate(){

JPanelp=(JPanel)frame.getContentPane();

JPanelp1=newJPanel();

p.setLayout(newFlowLayout());

p.add(label1);

p.setSize(5,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(newJLabel("

p.add(logonButton2);

p.add(cancelButton);

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.setBounds(200,100,750,550);

if(logonButton1.equals(e.getSource())&

&

(username.getText().equals("

123"

)==true)&

(password.getText().equals("

)==true)){

GZGLZJMgz=newGZGLZJM();

gz.create();

else{JOptionPane.showMessageDialog(null,"

对不起,你输入的密码错误!

"

};

if(logonButton2.equals(e.getSource())&

(username.getText().equals(t1.getText())==true)&

(password.getText().equals(t2.getText())==true)){

XKxk=newXK();

xk.create();

Connectioncon;

Statementsql;

ResultSetrs;

Vectorvector=newVector();

try{

Class.forName("

sun.jdbc.odbc.JdbcOdbcDriver"

}catch(ClassNotFoundExceptione1){

System.out.println("

+e1);

}

try{

con=DriverManager.getConnection("

jdbc:

odbc:

"

sql=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);

sql.executeQuery("

SELECTGno,mmFROMYWHEREGno="

+t1.getText()+"

ANDmm="

+t2.getText());

}catch(SQLExceptione1){

System.out.println(e1);

if(cancelButton.equals(e.getSource())){

System.exit(0);

}

classGZGLZJMextendsJFrameimplementsActionListener{

JFramef=newJFrame("

工资管理系统"

JButtonb1=newJButton("

津贴管理"

JButtonb2=newJButton("

总查询"

JButtonb3=newJButton("

工资管理"

JButtonb4=newJButton("

后勤管理"

JButtonb6=newJButton("

员工个人信息管理"

JButtonb5=newJButton("

返回"

ImageIconim=newImageIcon("

3.jpg"

JLabela3=newJLabel(im);

voidcreate(){

JPanelp=(JPanel)f.getContentPane();

p.add(b1);

p.add(b6);

p.add(b3);

p.add(b4);

p.add(b2);

p.add(b5);

p.add(a3);

p.setBackground(Color.red);

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.setVisible(true);

publicvoidactionPerformed(ActionEvente){

if(b5.equals(e.getSource())){//返回

DLd=newDL();

f.dispose();

if(b1.equals(e.getSource())){//津贴管理

JTGLjt=newJTGL();

jt.create();

if(b6.equals(e.getSource())){//员工个人信息管理

YGGLyg=newYGGL();

yg.create();

if(b2.equals(e.getSource())){//查询

if(b4.equals(e.getSource())){//后勤管理

KQGLkq=newKQGL();

kq.create();

if(b3.equals(e.getSource())){//工资管理

GZGLgz=newGZGL();

}

classKQGLimplementsActionListener{

录入修改删除考勤信息"

录入"

修改"

删除"

查询所有"

JTextFieldtf1=newJTextField(4);

JTextFieldtf2=newJTextField(4);

JTextFieldtf3=newJTextField(4);

JTextFieldtf4=newJTextField(4);

JTextFieldtf5=newJTextField(6);

JButtonb6=newJButton("

查询单人考勤"

String[]cloum={"

职工号"

"

缺勤天数"

缺勤类别"

缺勤时间"

};

Object[][]row=newObject[50][4];

JTabletable=newJTable(row,cloum);

JScrollPanescrollpane=newJScrollPane(table);

JSplitPanesplitpane=newJSplitPane(JSplitPane.VERTICAL_SPLIT);

voidcreate()

{

JPanelp=(JPanel)f.getContentPane();

//p.add(scrollpane);

p.add(splitpane);

p1.add(b1);

p1.add(b2);

p1.add(b3);

p1.add(b4);

p1.add(b6);

p1.add(b5);

JPanelp2=newJPanel();

p2.setBackground(Color.red);

p2.add(scrollpane);

JPanelp3=newJPanel();

p.setLayout(newFlowLayout());

p.add(newJLabel("

p.add(tf1);

p.add(tf2);

p.add(tf3);

p.add(tf4);

在此处输入职工号点击查询删除"

p.add(tf5);

splitpane.add(p1,splitpane.TOP);

splitpane.add(p2,splitpane.BOTTOM);

splitpane.setDividerLocation(50);

p.setBackground(Color.CYAN);

f.setBounds(200,100,500,600);

f.setResizable(true);

//可以调整界面大小

if(b1.equals(e.getSource())){//添加

Connectioncon;

Statementsql;

ResultSetrs;

Class.forName("

}catch(ClassNotFoundExceptione1){

System.out.println("

}

try{

con=DriverManager.getConnection("

sql=con.createStatement();

StringinsertStr="

INSERTINTOKVALUES"

+"

("

'

+tf1.getText()+"

+tf2.getText()+"

+tf3.getText()+"

+tf4.getText()+"

)"

;

sql.executeUpdate(insertStr);

con.close();

}catch(SQLExceptione1){

System.out.println(e1);

if(b2.equals(e.getSource())){//修改

sql.executeUpdate("

UPDATEKSETts="

+tf2.getText()+"

WHEREKno="

+tf1.getText()+"

UPDATEKSETlb="

+tf3.getText()+"

UPDATEKSETsj="

con.close();

if(b3.equals(e.getSource())){//删除

sql=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);

DELETEFROMKWHEREKno="

+tf5.getText());

}

if(b4.equals(e.getSource())){//查询全部

}

sa"

if(b4.equals(e.getSource())){

for(inti=0;

i<

50;

i++)

for(intj=0;

j<

4;

j++)

table.setValueAt("

i,j);

rs=sql.executeQuery("

SELECT*

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 小学教育 > 语文

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

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