java 职工信息管理系统源代码.docx

上传人:b****6 文档编号:13521171 上传时间:2023-06-14 格式:DOCX 页数:43 大小:23.24KB
下载 相关 举报
java 职工信息管理系统源代码.docx_第1页
第1页 / 共43页
java 职工信息管理系统源代码.docx_第2页
第2页 / 共43页
java 职工信息管理系统源代码.docx_第3页
第3页 / 共43页
java 职工信息管理系统源代码.docx_第4页
第4页 / 共43页
java 职工信息管理系统源代码.docx_第5页
第5页 / 共43页
java 职工信息管理系统源代码.docx_第6页
第6页 / 共43页
java 职工信息管理系统源代码.docx_第7页
第7页 / 共43页
java 职工信息管理系统源代码.docx_第8页
第8页 / 共43页
java 职工信息管理系统源代码.docx_第9页
第9页 / 共43页
java 职工信息管理系统源代码.docx_第10页
第10页 / 共43页
java 职工信息管理系统源代码.docx_第11页
第11页 / 共43页
java 职工信息管理系统源代码.docx_第12页
第12页 / 共43页
java 职工信息管理系统源代码.docx_第13页
第13页 / 共43页
java 职工信息管理系统源代码.docx_第14页
第14页 / 共43页
java 职工信息管理系统源代码.docx_第15页
第15页 / 共43页
java 职工信息管理系统源代码.docx_第16页
第16页 / 共43页
java 职工信息管理系统源代码.docx_第17页
第17页 / 共43页
java 职工信息管理系统源代码.docx_第18页
第18页 / 共43页
java 职工信息管理系统源代码.docx_第19页
第19页 / 共43页
java 职工信息管理系统源代码.docx_第20页
第20页 / 共43页
亲,该文档总共43页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

java 职工信息管理系统源代码.docx

《java 职工信息管理系统源代码.docx》由会员分享,可在线阅读,更多相关《java 职工信息管理系统源代码.docx(43页珍藏版)》请在冰点文库上搜索。

java 职工信息管理系统源代码.docx

java职工信息管理系统源代码

源代码

packagelesson2;

importjava。

sql。

*;

publicclassemployee

{

publicStringnum;

publicStringname;

publicStringsex;

publicStringage;

publicStringedu;

publicStringsla;

publicStringadd;

publicStringtel;

publicvoidinit(Stringx1,Stringx2,Stringx3,Stringx4,Stringx5,Stringx6,Stringx7,Stringx8)

num=x1;

name=x2;

sex=x3;

age=x4;

edu=x5;

sla=x6;

add=x7;

tel=x8;

publicvoidload(Stringf)

try

Class。

forName(”com.microsoft.sqlserver.jdbc。

SQLServerDriver”);

Stringurl=”jdbc:

sqlserver:

//localhost:

1433;DatabaseName=employee";

StringuserName=”sa”;

Stringpassword="xhw";

Connectionconn=DriverManager.getConnection(url,userName,password);

if(conn!

=null)

System.out。

println(”已成功地与SQLServer2005数据库建立连接!

");

Statementstmt=conn.createStatement();

stmt.executeUpdate(f);

stmt。

close();

catch(Exceptione)

{

e。

printStackTrace();

packagelesson2;

importjava.awt.*;

importjava。

awt.event。

*;

importjava。

sql。

*;

publicclasslesson2_1

{

staticFramef;

CardLayoutmyCard;

Panelp1;

Panelp2;

Panelp3;

Panelp4;

Panelp5;

Panelp6;

Panelp7;

Panelp8;

publicstaticvoidmain(String[]args)

{

lesson2_1test=newlesson2_1();

test.go1();

test.go2();

test.go3();

test。

go4();

test.go5();

test.go6();

test。

go7();

test。

go8();

publicvoidgo1()

f=newFrame(”呵呵!

!

!

");

myCard=newCardLayout();

f.setLayout(myCard);

p1=newPanel();

Buttonb1,b2,b3;

LabelL1;

TextFieldte1;

finalTextFieldte2;

p1。

setLayout(newGridBagLayout());

GridBagConstraintsc=newGridBagConstraints();

Panelp1_1=newPanel();

p1_1.setLayout(newGridBagLayout());

GridBagConstraintsx=newGridBagConstraints();

b1=newButton("请输入用户名”);

b1.setBackground(Color。

CYAN);

x.insets=newInsets(50,50,50,50);

x.gridx=0;

x.gridy=0;

x.gridwidth=1;

x.gridheight=1;

p1_1。

add(b1,x);

b2=newButton("请输入密码");

b2。

setBackground(Color。

CYAN);

x。

gridx=0;

x.gridy=5;

x.gridwidth=1;

x。

gridheight=1;

p1_1。

add(b2,x);

te1=newTextField(15);

c.insets=newInsets(40,0,40,0);

x.gridx=5;

x。

gridy=0;

x。

gridwidth=1;

x。

gridheight=1;

p1_1。

add(te1,x);

te2=newTextField(15);

x。

gridx=5;

x.gridy=5;

x。

gridwidth=1;

x.gridheight=1;

p1_1。

add(te2,x);

L1=newLabel(”**********欢迎进入职工管理系统**************");

L1。

setBackground(Color。

CYAN);

c.gridx=0;

c.gridy=0;

c.gridwidth=0;

c。

gridheight=1;

p1。

add(L1,c);

b3=newButton("登录”);

b3。

setBackground(Color.CYAN);

c。

gridx=0;

c。

gridy=10;

c。

gridwidth=5;

c.gridheight=5;

p1。

add(b3,c);

c.gridx=0;

c。

gridy=20;

c.gridwidth=5;

c。

gridheight=5;

p1。

add(p1_1,c);

p1。

setBackground(Color.green);

f。

add(p1,”First”);

myCard.show(f,"First");

f。

setSize(600,600);

f。

setVisible(true);

f.addWindowListener(

newWindowAdapter()

publicvoidwindowClosing(WindowEvente)

System.exit(0);

}

);

b3.addMouseListener(newMouseAdapter(){

publicvoidmouseClicked(MouseEvente)

Stringx=te2.getText();

inty=Integer。

parseInt(x);

if(y==106)

myCard.show(f,”Second");

});

publicvoidgo2()

p2=newPanel();

Buttonb1,b2,b3,b4,b5,b6;

LabelL1;

p2。

setLayout(newGridBagLayout());

GridBagConstraintsc=newGridBagConstraints();

c.insets=newInsets(50,0,8,0);

b1=newButton("1职工信息录入");

b1。

setBackground(Color。

CYAN);

c。

gridx=1;

c.gridy=50;

c.gridwidth=5;

c.gridheight=50;

p2。

add(b1,c);

b2=newButton(”2职工信息浏览”);

b2.setBackground(Color。

CYAN);

c。

gridx=1;

c.gridy=100;

c.gridwidth=5;

c。

gridheight=50;

p2。

add(b2,c);

b3=newButton(”3职工信息查询");

b3。

setBackground(Color。

CYAN);

c。

gridx=1;

c.gridy=150;

c。

gridwidth=5;

c。

gridheight=50;

p2.add(b3,c);

b4=newButton(”4职工信息排序”);

b4.setBackground(Color.CYAN);

c。

gridx=1;

c。

gridy=200;

c.gridwidth=5;

c.gridheight=50;

p2。

add(b4,c);

b5=newButton("5职工信息修改”);

b5.setBackground(Color。

CYAN);

c.gridx=1;

c。

gridy=250;

c.gridwidth=5;

c。

gridheight=50;

p2.add(b5,c);

b6=newButton("6职工信息删除”);

b6.setBackground(Color。

CYAN);

c.gridx=1;

c。

gridy=300;

c.gridwidth=5;

c。

gridheight=50;

p2。

add(b6,c);

L1=newLabel(”********欢迎进入职工管理系统**********");

L1.setBackground(Color。

CYAN);

c。

gridx=1;

c。

gridy=0;

c。

gridwidth=5;

c.gridheight=10;

p2.add(L1,c);

p2。

setBackground(Color。

green);

f。

add(p2,"Second”);

b1。

addMouseListener(newMouseAdapter(){

publicvoidmouseClicked(MouseEvente)

{

myCard.show(f,”Third");

});

b2。

addMouseListener(newMouseAdapter(){

publicvoidmouseClicked(MouseEvente)

myCard。

show(f,”Fourth”);

});

b3.addMouseListener(newMouseAdapter(){

publicvoidmouseClicked(MouseEvente)

{

myCard。

show(f,”Fifth");

}

});

b4。

addMouseListener(newMouseAdapter(){

publicvoidmouseClicked(MouseEvente)

myCard.show(f,”Sixth”);

}

});

b5.addMouseListener(newMouseAdapter(){

publicvoidmouseClicked(MouseEvente)

myCard.show(f,”Seventh");

});

b6。

addMouseListener(newMouseAdapter(){

publicvoidmouseClicked(MouseEvente)

myCard。

show(f,”Eighth");

});

publicvoidgo3()

{

p3=newPanel();

p3.setLayout(newGridBagLayout());

GridBagConstraintsc=newGridBagConstraints();

Buttonb1,b2,b3,b4,b5,b6,b7,b8,b9,b10;

finalTextFieldte1,te2,te3,te4,te5,te6,te7,te8;

LabelL1;

c.insets=newInsets(60,50,0,0);

L1=newLabel(”***************请输入下面信息****************");

L1.setBackground(Color.CYAN);

c。

gridx=0;

c.gridy=0;

c。

gridwidth=0;

c.gridheight=1;

p3。

add(L1,c);

b1=newButton(”工号");

b1。

setBackground(Color。

CYAN);

c.gridx=0;

c.gridy=10;

c.gridwidth=1;

c。

gridheight=1;

p3.add(b1,c);

b2=newButton(”姓名”);

b2。

setBackground(Color.CYAN);

c。

gridx=35;

c.gridy=10;

c.gridwidth=1;

c.gridheight=1;

p3.add(b2,c);

b3=newButton("性别”);

b3。

setBackground(Color。

CYAN);

c。

gridx=0;

c。

gridy=30;

c。

gridwidth=1;

c。

gridheight=1;

p3.add(b3,c);

b4=newButton("年龄”);

b4.setBackground(Color.CYAN);

c.gridx=35;

c。

gridy=30;

c.gridwidth=1;

c.gridheight=1;

p3.add(b4,c);

b5=newButton("学历");

b5。

setBackground(Color.CYAN);

c.gridx=0;

c。

gridy=50;

c。

gridwidth=1;

c。

gridheight=1;

p3。

add(b5,c);

b6=newButton("工资");

b6。

setBackground(Color。

CYAN);

c.gridx=35;

c。

gridy=50;

c.gridwidth=1;

c。

gridheight=1;

p3。

add(b6,c);

b7=newButton("住址");

b7。

setBackground(Color。

CYAN);

c。

gridx=0;

c.gridy=70;

c.gridwidth=1;

c.gridheight=1;

p3.add(b7,c);

b8=newButton("电话");

b8。

setBackground(Color。

CYAN);

c.gridx=35;

c.gridy=70;

c.gridwidth=1;

c。

gridheight=1;

p3。

add(b8,c);

b9=newButton(”提交”);

b9.setBackground(Color。

CYAN);

c。

gridx=10;

c.gridy=100;

c。

gridwidth=1;

c。

gridheight=1;

p3.add(b9,c);

b10=newButton(”返回”);

b10.setBackground(Color.CYAN);

c.gridx=35;

c.gridy=100;

c。

gridwidth=1;

c.gridheight=1;

p3。

add(b10,c);

te1=newTextField(10);

c.gridx=10;

c.gridy=10;

c.gridwidth=1;

c.gridheight=1;

p3.add(te1,c);

te2=newTextField(10);

c。

gridx=37;

c。

gridy=10;

c.gridwidth=1;

c.gridheight=1;

p3.add(te2,c);

te3=newTextField(10);

c。

gridx=10;

c.gridy=30;

c。

gridwidth=1;

c.gridheight=1;

p3.add(te3,c);

te4=newTextField(10);

c。

gridx=37;

c。

gridy=30;

c.gridwidth=1;

c。

gridheight=1;

p3。

add(te4,c);

te5=newTextField(10);

c。

gridx=10;

c.gridy=50;

c.gridwidth=1;

c。

gridheight=1;

p3。

add(te5,c);

te6=newTextField(10);

c.gridx=37;

c.gridy=50;

c.gridwidth=1;

c.gridheight=1;

p3.add(te6,c);

te7=newTextField(10);

c。

gridx=10;

c.gridy=70;

c.gridwidth=1;

c.gridheight=1;

p3.add(te7,c);

te8=newTextField(10);

c.gridx=37;

c。

gridy=70;

c.gridwidth=1;

c。

gridheight=1;

p3。

add(te8,c);

p3。

setBackground(Color。

green);

f。

add(p3,”Third");

b9.addMouseListener(newMouseAdapter(){

publicvoidmouseClicked(MouseEvente)

{

employeee1=newemployee();

e1.init(te1.getText(),te2。

getText(),te3.getText(),te4。

getText(),

te5。

getText(),te6。

getText(),te7.getText(),te8。

getText());

Stringx=”’";

Stringy="’";

Stringz=”,";

Stringw=")";

Stringsql="insertintoxhwvalues(”;

sql=sql+x+e1。

num+y+z+x+e1.name+y+z+x+e1.sex+y+z+x+e1.age+y+z+x+e1。

edu+y+z

+x+e1.sla+y+z+x+e1.add+y+z+x+e1。

tel+y+w;

e1.load(sql);

te1.setText(””);

te2.setText(””);

te3。

setText("");

te4.setText(””);

te5。

setText(”");

te6。

setText("”);

te7。

setText(””);

te8。

setText("");

}

});

b10。

addMouseListener(newMouseAdapter(){

publicvoidmouseClicked(MouseEvente)

myCard。

show(f,"Second");

});

publicvoidgo4()

p4=newPanel();

p4.setLayout(newGridBagLayout());

GridBagConstraintsc=newGridBagConstraints();

Buttonb1,b2;

LabelL1;

finalTextAreata;

c.insets=newInsets(60,0,0,0);

L1=newLabel(”***************欢迎进入信息浏览界面****************");

L1.setBackground(Color。

CYAN);

c。

gridx=0;

c.gridy=0;

c。

gridwidth=0;

c.gridheight=1;

p4。

add(L1,c);

b1=newButton(”浏览”);

b1.setBackground(Color.CYAN);

c.gridx=0;

c.gridy=10;

c.gridwidth=1;

c.gridheight=1;

p4。

add(b1,c);

b2=newButton(”返回”);

b2。

setBackground(

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

当前位置:首页 > 求职职场 > 简历

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2