java 职工信息管理系统源代码Word格式文档下载.docx
- 文档编号:20608938
- 上传时间:2023-01-24
- 格式:DOCX
- 页数:42
- 大小:21.90KB
java 职工信息管理系统源代码Word格式文档下载.docx
《java 职工信息管理系统源代码Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《java 职工信息管理系统源代码Word格式文档下载.docx(42页珍藏版)》请在冰豆网上搜索。
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();
}
}
importjava.awt.*;
importjava.awt.event.*;
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.gridy=5;
p1_1.add(b2,x);
te1=newTextField(15);
c.insets=newInsets(40,0,40,0);
x.gridx=5;
p1_1.add(te1,x);
te2=newTextField(15);
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.gridy=10;
c.gridwidth=5;
c.gridheight=5;
p1.add(b3,c);
c.gridy=20;
p1.add(p1_1,c);
p1.setBackground(Color.green);
f.add(p1,"
First"
myCard.show(f,"
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;
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.gridy=100;
p2.add(b2,c);
b3=newButton("
3职工信息查询"
b3.setBackground(Color.CYAN);
c.gridy=150;
p2.add(b3,c);
b4=newButton("
4职工信息排序"
b4.setBackground(Color.CYAN);
c.gridy=200;
p2.add(b4,c);
b5=newButton("
5职工信息修改"
b5.setBackground(Color.CYAN);
c.gridy=250;
p2.add(b5,c);
b6=newButton("
6职工信息删除"
b6.setBackground(Color.CYAN);
c.gridy=300;
p2.add(b6,c);
L1=newLabel("
********欢迎进入职工管理系统**********"
L1.setBackground(Color.CYAN);
c.gridy=0;
c.gridheight=10;
p2.add(L1,c);
p2.setBackground(Color.green);
f.add(p2,"
b1.addMouseListener(newMouseAdapter(){
publicvoidmouseClicked(MouseEvente)
myCard.show(f,"
Third"
});
b2.addMouseListener(newMouseAdapter(){
Fourth"
b3.addMouseListener(newMouseAdapter(){
Fifth"
b4.addMouseListener(newMouseAdapter(){
Sixth"
b5.addMouseListener(newMouseAdapter(){
Seventh"
b6.addMouseListener(newMouseAdapter(){
Eighth"
publicvoidgo3()
p3=newPanel();
p3.setLayout(newGridBagLayout());
Buttonb1,b2,b3,b4,b5,b6,b7,b8,b9,b10;
finalTextFieldte1,te2,te3,te4,te5,te6,te7,te8;
c.insets=newInsets(60,50,0,0);
***************请输入下面信息****************"
p3.add(L1,c);
工号"
c.gridwidth=1;
p3.add(b1,c);
姓名"
c.gridx=35;
p3.add(b2,c);
性别"
c.gridy=30;
p3.add(b3,c);
b4=newButton("
年龄"
b4.setBackground(Color.CYAN);
p3.add(b4,c);
b5=newButton("
学历"
b5.setBackground(Color.CYAN);
c.gridy=50;
p3.add(b5,c);
b6=newButton("
工资"
b6.setBackground(Color.CYAN);
p3.add(b6,c);
b7=newButton("
住址"
b7.setBackground(Color.CYAN);
c.gridy=70;
p3.add(b7,c);
b8=newButton("
电话"
b8.setBackground(Color.CYAN);
p3.add(b8,c);
b9=newButton("
提交"
b9.setBackground(Color.CYAN);
c.gridx=10;
c.gridy=100;
p3.add(b9,c);
b10=newButton("
返回"
b10.setBackground(Color.CYAN);
p3.add(b10,c);
te1=newTextField(10);
p3.add(te1,c);
te2=newTextField(10);
c.gridx=37;
p3.add(te2,c);
te3=newTextField(10);
p3.add(te3,c);
te4=newTextField(10);
p3.add(te4,c);
te5=newTextField(10);
p3.add(te5,c);
te6=newTextField(10);
p3.add(te6,c);
te7=newTextField(10);
p3.add(te7,c);
te8=newTextField(10);
p3.add(te8,c);
p3.setBackground(Color.green);
f.add(p3,"
b9.addMouseListener(newMouseAdapter(){
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(){
publicvoidgo4()
p4=newPanel();
p4.setLayout(newGridBagLayout());
Buttonb1,b2;
finalTextAreata;
c.insets=newInsets(60,0,0,0);
*
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- java 职工信息管理系统源代码 职工 信息管理 系统 源代码
![提示](https://static.bdocx.com/images/bang_tan.gif)