java考勤管理系统数据库实现Word文档格式.docx

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

java考勤管理系统数据库实现Word文档格式.docx

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

java考勤管理系统数据库实现Word文档格式.docx

addActionListener(this);

button2.addActionListener(this);

frame。

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.pack();

setBounds(200,100,550,600);

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{

JFrameframe=newJFrame("

职工/管理员登陆”);

JLabellabel1=newJLabel(”用户名”);

JLabellabel2=newJLabel(”密码"

JButtonlogonButton1=newJButton(”管理员登录”);

JButtonlogonButton2=newJButton(”职工登录"

);

JButtoncancelButton=newJButton("

退出"

JTextFieldt1=newJTextField(0);

JTextFieldt2=newJTextField(0);

ImageIconim=newImageIcon("

2。

JLabela2=newJLabel(im);

JTextFieldusername=newJTextField(9);

JPasswordFieldpassword=newJPasswordField(9);

voidcreate(){

JPanelp=(JPanel)frame.getContentPane();

JPanelp1=newJPanel();

p。

setLayout(newFlowLayout());

p.add(label1);

setSize(5,5);

setLocation(4,8);

add(username);

setSize(100,200);

p.setLocation(800,800);

p.add(label2);

p.setSize(50,20);

setLocation(40,80);

p.add(password);

setSize(100,20);

setLocation(80,120);

p.add(logonButton1);

add(newJLabel("

"

));

p.add(logonButton2);

add(cancelButton);

”));

add(a2);

p.add(t1);

add(t2);

p.setBackground(Color.blue);

p.setVisible(true);

logonButton1.addActionListener(this);

logonButton2.addActionListener(this);

cancelButton。

addActionListener(this);

frame.setDefaultCloseOperation(JFrame。

EXIT_ON_CLOSE);

pack();

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

frame.setVisible(true);

publicvoidactionPerformed(ActionEvente){

if(logonButton1.equals(e。

getSource())&

&

(username。

getText()。

equals(”123”)==true)&

&(password。

equals(”123"

)==true)){

GZGLZJMgz=newGZGLZJM();

gz。

create();

}

else{JOptionPane。

showMessageDialog(null,”对不起,你输入的密码错误!

"

};

if(logonButton2。

equals(e.getSource())&&(username.getText()。

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

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:

123”,””,"

sql=con。

createStatement(ResultSet。

TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);

sql.executeQuery("

SELECTGno,mmFROMYWHEREGno="

+t1.getText()+"

ANDmm="

+t2.getText());

}catch(SQLExceptione1){

out.println(e1);

}

if(cancelButton。

equals(e.getSource())){

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();

JPanelp1=newJPanel();

setLayout(newFlowLayout());

p.add(b1);

p.add(newJLabel(””));

p.add(b6);

p.add(newJLabel("

p.add(b3);

p.add(newJLabel(””));

p.add(b4);

p.add(b2);

add(b5);

add(a3);

p.setBackground(Color.red);

setVisible(true);

b1。

b2.addActionListener(this);

b3.addActionListener(this);

b4.addActionListener(this);

b5.addActionListener(this);

b6.addActionListener(this);

f。

setBounds(200,100,800,600);

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。

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

XKxk=newXK();

xk。

if(b4。

getSource())){//后勤管理

KQGLkq=newKQGL();

kq。

if(b3。

getSource())){//工资管理

GZGLgz=newGZGL();

}

classKQGLimplementsActionListener{

JFramef=newJFrame(”录入修改删除考勤信息"

JButtonb1=newJButton(”录入”);

JButtonb2=newJButton("

修改”);

JButtonb3=newJButton("

删除"

JButtonb4=newJButton(”查询所有"

JButtonb5=newJButton(”返回"

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.setLayout(newFlowLayout());

//p。

add(scrollpane);

p.add(splitpane);

p1。

add(b1);

add(b2);

p1.add(b3);

add(b4);

add(b6);

p1.add(b5);

JPanelp2=newJPanel();

p2。

setBackground(Color.red);

add(scrollpane);

JPanelp3=newJPanel();

p.setLayout(newFlowLayout());

p。

add(newJLabel(”"

职工号”));

add(tf1);

缺勤天数”));

p.add(tf2);

缺勤类别”));

p.add(tf3);

p.add(newJLabel("

p.add(newJLabel(”缺勤时间”));

p.add(tf4);

add(newJLabel(”在此处输入职工号点击查询删除"

p.add(tf5);

splitpane。

add(p1,splitpane。

TOP);

add(p2,splitpane。

BOTTOM);

splitpane.setDividerLocation(50);

setBackground(Color。

CYAN);

b2。

b3。

b5。

setBounds(200,100,500,600);

setResizable(true);

//可以调整界面大小

f.setVisible(true);

if(b1。

getSource())){//添加

Connectioncon;

Statementsql;

ResultSetrs;

Class.forName(”sun.jdbc。

odbc.JdbcOdbcDriver”);

}catch(ClassNotFoundExceptione1){

System.out。

println(”"

+e1);

try{

con=DriverManager。

getConnection("

jdbc:

odbc:

123”,””,"

”);

sql=con.createStatement();

StringinsertStr="

INSERTINTOKVALUES”+"

(”+”'

”+tf1.getText()+”’"

+"

"

+tf2.getText()+"

”+"

'

”+tf3。

getText()+"

”+”,”+tf4。

)”;

sql.executeUpdate(insertStr);

con.close();

}catch(SQLExceptione1){

println(e1);

if(b2.equals(e。

getSource())){//修改

Connectioncon;

Statementsql;

Class.forName(”sun。

jdbc.odbc。

JdbcOdbcDriver"

+e1);

try{

con=DriverManager.getConnection(”jdbc:

123"

””,"

sql.executeUpdate("

UPDATEKSETts=”+tf2。

getText()+”WHEREKno=”+tf1.getText()+"

sql.executeUpdate(”UPDATEKSETlb=”+tf3.getText()+”WHEREKno="

+tf1.getText()+”"

sql.executeUpdate(”UPDATEKSETsj="

+tf4.getText()+”WHEREKno=”+tf1.getText()+"

con。

close();

System.out。

if(b3。

getSource())){//删除

Class。

forName("

sun。

System.out.println("

getConnection(”jdbc:

123”,"

”,”"

sql=con。

DELETEFROMKWHEREKno=”+tf5.getText());

close();

System.out.println(e1);

if(b4.equals(e。

getSource())){//查询全部

Vectorvector=newVector();

try{

Class。

}catch(ClassNotFoundExceptione1){

try{

con=DriverManager.getConnection(”jdbc:

,"

sa”,””);

sql=con.createStatement(ResultSet。

TYPE_SCROLL_SENSITIVE,ResultSet。

CONCUR_READ_ONLY);

if(b4。

getSource())){

for(inti=0;

i<

50;

i++)

for(intj=0;

j〈4;

j++)

table。

setValueAt(”"

,i,j);

rs=sql。

executeQuery(”SELECT*FROMKORD

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

当前位置:首页 > PPT模板 > 其它模板

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

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