java考勤管理系统数据库实现范本模板Word格式.docx
- 文档编号:19056353
- 上传时间:2023-01-03
- 格式:DOCX
- 页数:16
- 大小:18.84KB
java考勤管理系统数据库实现范本模板Word格式.docx
《java考勤管理系统数据库实现范本模板Word格式.docx》由会员分享,可在线阅读,更多相关《java考勤管理系统数据库实现范本模板Word格式.docx(16页珍藏版)》请在冰豆网上搜索。
pcontentPane.setBackground(Color。
green);
setVisible(true);
button1。
addActionListener(this);
button2.addActionListener(this);
frame.setDefaultCloseOperation(JFrame。
EXIT_ON_CLOSE);
frame。
pack();
setBounds(200,100,550,600);
}
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);
ImageIconim=newImageIcon(”2。
jpg”);
JLabela2=newJLabel(im);
JTextFieldusername=newJTextField(9);
JPasswordFieldpassword=newJPasswordField(9);
voidcreate(){
JPanelp=(JPanel)frame。
getContentPane();
JPanelp1=newJPanel();
p。
p.add(label1);
setSize(5,5);
p.setLocation(4,8);
add(username);
p.setSize(100,200);
p.setLocation(800,800);
add(label2);
setSize(50,20);
p.setLocation(40,80);
p.add(password);
setSize(100,20);
p.setLocation(80,120);
p.add(logonButton1);
add(newJLabel("
"
));
add(logonButton2);
add(newJLabel(”"
add(cancelButton);
add(newJLabel(””));
add(a2);
add(t1);
p.add(t2);
setBackground(Color。
blue);
logonButton1。
logonButton2。
addActionListener(this);
cancelButton。
setDefaultCloseOperation(JFrame。
frame.setBounds(200,100,750,550);
frame.setVisible(true);
if(logonButton1.equals(e。
getSource())&&(username.getText()。
equals(”123"
)==true)&
&(password.getText().equals(”123”)==true)){
GZGLZJMgz=newGZGLZJM();
gz.create();
else{JOptionPane.showMessageDialog(null,"
对不起,你输入的密码错误!
”);
};
if(logonButton2。
equals(e.getSource())&&
(username。
getText()。
equals(t1.getText())==true)&
&
(password。
equals(t2。
getText())==true)){
XKxk=newXK();
xk。
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){
println(e1);
}
if(cancelButton。
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();
add(b1);
add(newJLabel(””));
p.add(b6);
p.add(b3);
p.add(newJLabel("
p.add(b4);
p.add(b2);
p.add(newJLabel(””));
add(b5);
add(a3);
red);
p.setVisible(true);
b1.addActionListener(this);
b2。
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
b6。
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())){//查询
xk.create();
if(b4.equals(e。
getSource())){//后勤管理
KQGLkq=newKQGL();
kq。
if(b3.equals(e.getSource())){//工资管理
GZGLgz=newGZGL();
gz.create();
}
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。
setLayout(newFlowLayout());
//p。
add(scrollpane);
p.add(splitpane);
p1。
add(b1);
p1.add(b2);
p1.add(b3);
add(b4);
p1.add(b6);
p1.add(b5);
JPanelp2=newJPanel();
p2.setBackground(Color.red);
p2.add(scrollpane);
JPanelp3=newJPanel();
p。
p.add(newJLabel(”"
职工号"
));
add(tf1);
add(newJLabel(”缺勤天数"
p.add(tf2);
p.add(newJLabel(”缺勤类别"
p.add(tf3);
p.add(newJLabel("
”));
缺勤时间”));
p.add(tf4);
在此处输入职工号点击查询删除"
add(tf5);
splitpane。
add(p1,splitpane.TOP);
splitpane.add(p2,splitpane。
BOTTOM);
splitpane.setDividerLocation(50);
p.setBackground(Color.CYAN);
b1。
b3。
b4。
b5。
f.setBounds(200,100,500,600);
f。
setResizable(true);
//可以调整界面大小
f.setVisible(true);
publicvoidactionPerformed(ActionEvente){
if(b1。
getSource())){//添加
Connectioncon;
Statementsql;
ResultSetrs;
try{
Class。
forName(”sun.jdbc.odbc.JdbcOdbcDriver"
}catch(ClassNotFoundExceptione1){
System。
println("
+e1);
}
try{
con=DriverManager.getConnection(”jdbc:
odbc:
,"
sql=con.createStatement();
StringinsertStr=”INSERTINTOKVALUES"
+"
("
'
”+tf1.getText()+”’”+”,”+tf2。
getText()+"
”+"
+tf3。
getText()+”'
”+”,”+tf4。
)”;
sql.executeUpdate(insertStr);
con.close();
}catch(SQLExceptione1){
System。
if(b2.equals(e.getSource())){//修改
Connectioncon;
ResultSetrs;
forName(”sun.jdbc。
odbc.JdbcOdbcDriver"
”+e1);
}
try{
con=DriverManager.getConnection("
jdbc:
,””,"
”);
sql.executeUpdate(”UPDATEKSETts="
+tf2.getText()+”WHEREKno=”+tf1。
sql.executeUpdate(”UPDATEKSETlb="
+tf3.getText()+”WHEREKno=”+tf1。
sql.executeUpdate(”UPDATEKSETsj=”+tf4。
WHEREKno="
+tf1。
con.close();
}catch(SQLExceptione1){
System.out.println(e1);
if(b3.equals(e。
getSource())){//删除
Class.forName("
sun.jdbc.odbc。
JdbcOdbcDriver"
out.println(””+e1);
con=DriverManager。
getConnection("
,””,”"
sql=con。
createStatement(ResultSet。
TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
sql。
executeUpdate(”DELETEFROMKWHEREKno=”+tf5。
getText());
}catch(SQLExceptione1){
}
if(b4。
equals(e.getSource())){//查询全部
Connectioncon;
Statementsql;
Vectorvector=newVector();
Class.forName(”sun。
jdbc。
odbc。
JdbcOdbcDriver”);
System.out。
}
con=DriverManager.getConnection("
jdbc:
,”sa”,””);
TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
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*FROMK
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- java 考勤 管理 系统 数据库 实现 范本 模板