课程设计考勤管理系统源代码样本_第1页
课程设计考勤管理系统源代码样本_第2页
课程设计考勤管理系统源代码样本_第3页
课程设计考勤管理系统源代码样本_第4页
课程设计考勤管理系统源代码样本_第5页
已阅读5页,还剩81页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

packagekaoqin;importjavax.swing.*;importjava.awt.*;importjava.awt.event.*;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava.sql.*;classAttendFrameextendsJFrame//工作制类型{ publicAttendFrame() { this.setTitle("工作制类型"); this.setVisible(true); this.setContentPane(newJPanel()); this.setSize(300,200); create(); } privatevoidcreate() { JButtonb1,b2,b3; Boxbox1 b1=newJButton("非弹性工作制"); b2=newJButton("弹性工作制"); b3=newJButton("返回"); box1=Box.createHorizontalBox(); box2=Box.createHorizontalBox(); box=Box.createVerticalBox(); box1.add(b1); box1.add(Box.createHorizontalStrut(20)); box1.add(b2); box2.add(b3); box.add(box1); box.add(Box.createVerticalStrut(30)); box.add(box2); this.add(box); b1.addActionListener(newActionListener()// { @Override publicvoidactionPerformed(ActionEvente) { //TODO自动生成办法存根 UBoundFrameframe=newUBoundFrame(); dispose(); } }); b2.addActionListener(newActionListener()// { @Override publicvoidactionPerformed(ActionEvente) { //TODO自动生成办法存根 BoundFrameframe=newBoundFrame(); dispose(); } }); b3.addActionListener(newActionListener()// { @Override publicvoidactionPerformed(ActionEvente) { //TODO自动生成办法存根 MFrameframe=newMFrame(); dispose(); } }); }}packagekaoqin;importjavax.swing.*;importjava.awt.*;importjava.awt.event.*;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava.sql.*;classBoundFrameextendsJFrame{ publicBoundFrame() { this.setTitle("弹性工作制"); this.setVisible(true); this.setContentPane(newJPanel()); this.setSize(400,400); create(); } JLabelk1,k2,k3,k4,k5,k6; JTextFieldf1,f2,f3,f4,f5,f6; Boxbox1,box2,box3,box4,box5,box; JButtonb1; privatevoidcreate() { k1=newJLabel("工号:"); k2=newJLabel("姓名:"); k3=newJLabel("当月工时:"); k4=newJLabel(":"); k5=newJLabel("当月工作天数"); k6=newJLabel("当月富余:"); b1=newJButton("返回"); f1=newJTextField(5); f2=newJTextField(5); f3=newJTextField(5); f4=newJTextField(5); f5=newJTextField(5); f6=newJTextField(5); box1=Box.createHorizontalBox(); box2=Box.createHorizontalBox(); box3=Box.createHorizontalBox(); box4=Box.createHorizontalBox(); box5=Box.createHorizontalBox(); box=Box.createVerticalBox(); box1.add(k1); box1.add(f1); box1.add(Box.createHorizontalStrut(20)); box1.add(k2); box1.add(f2); box2.add(k3); box2.add(f3); box2.add(k4); box2.add(f4); box3.add(k5); box3.add(f5); box4.add(k6); box4.add(f6); box5.add(b1); box.add(box1); box.add(Box.createVerticalStrut(20)); box.add(box2); box.add(Box.createVerticalStrut(20)); box.add(box3); box.add(Box.createVerticalStrut(20)); box.add(box4); box.add(Box.createVerticalStrut(20)); box.add(box5); this.add(box); b1.addActionListener(newActionListener()//拟定{@OverridepublicvoidactionPerformed(ActionEvente){//TODO自动生成办法存根AttendFrameframe=newAttendFrame();dispose();}}); }}packagekaoqin;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;publicclassConnectionDB{ privateStringJDriver="sun.jdbc.odbc.JdbcOdbcDriver"; privateStringsqlURL="jdbc:odbc:bobo"; //privateStringJDriver="com.microsoft.sqlserver.jdbc.SQLServerDriver"; //privateStringsqlURL="jdbc:sqlserver://localhost:1433;DatabaseName=MyTest;integratedSecurity=TRUE;"; privateConnectionconnection; privateStatementstatement; privatestaticConnectionconn=null; privateString[]tableSQL=newString[4]; publicConnectionDB(){ try{ Class.forName(JDriver); connection=DriverManager.getConnection(sqlURL); statement=connection.createStatement(); }catch(ClassNotFoundExceptione){ e.printStackTrace(); }catch(SQLExceptione){ e.printStackTrace(); } } publicConnectiongetConnection(){ returnconnection; } publicStatementgetStatement(){ returnstatement; } publicvoidbreakDB(){ try{ statement.close(); connection.close(); }catch(SQLExceptione){ e.printStackTrace(); } } publicvoidcreateTable(){ tableSQL[0]="createtablestaff_info("+ "Snochar(9)primarykey,"+ "Snamechar(10)notnull,"+ "Sagesmallint,"+ "enter_timechar(10)notnull,"+ "positionchar(10)notnull,"+ "sexchar(1),"+ "passwordchar(6));"; tableSQL[1]="createtablepz_info("+ "arrive_hourchar(2),"+ "arrive_minutechar(2),"+ "leave_hourchar(2),"+ "leave_minutechar(2),"+ "everyday_timechar(2));"; tableSQL[2]="createtableeverymonth_statistics("+ "Snochar(9)notnull,"+ "Snamechar(10)notnull,"+ "remain_timechar(4),"+ "late_timessmallint,"+ "early_leavesmallint,"+ "work_daysmallint,"+ "primarykey(Sno),"+ "foreignkey(Sno)"+ "referencesstaff_info(Sno)ondeletecascade);"; tableSQL[3]="createtableeveryday_statistics("+ "Snochar(9)notnull,"+ "Snamechar(10)notnull,"+ "hourchar(2),"+ "minutechar(2),"+ "actionchar(6),"+ "timechar(4),"+ "primarykey(Sno),"+ "foreignkey(Sno)"+ "referencesstaff_info(Sno)ondeletecascade);"; try{ for(inti=0;i<4;i++) statement.executeUpdate(tableSQL[i]); }catch(SQLExceptione){ e.printStackTrace(); } } privatestaticResultSetexecuteQuery(Stringsql){ try{ if(conn==null) newConnectionDB(); returnconn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE).executeQuery(sql); }catch(SQLExceptione){ e.printStackTrace(); returnnull; }finally{ }}}packagekaoqin;importjavax.swing.*;importjava.awt.*;importjava.awt.event.*;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava.sql.*;classEqu_FrameextendsJFrame//配备信息{ publicEqu_Frame() { this.setTitle("配备信息"); this.setSize(400,400); this.setContentPane(newJPanel()); this.setVisible(true); this.create(); } JLabelk1,k2,k3,k4,k5,k6,k7,k8,k9,k10; JLabelf1,f2,f3,f4,f5,f6,f7,f8,f9,f10; Boxbox1,box2,box3,box4,box5,box6,box7,box; JButtonb1,b2; privatevoidcreate() { k1=newJLabel("上班时间:"); k2=newJLabel(":"); k3=newJLabel("下班时间:"); k4=newJLabel(":"); k5=newJLabel("每月工作总时间:"); k6=newJLabel("每月工作天数:"); k7=newJLabel("每月工作日期:"); k8=newJLabel("~"); k9=newJLabel("每月放假日期:"); k10=newJLabel("~"); b1=newJButton("修改"); b2=newJButton("返回"); f1=newJLabel("08"); f2=newJLabel("30"); f3=newJLabel("17"); f4=newJLabel("30"); f5=newJLabel("200"); f6=newJLabel("22"); f7=newJLabel("星期一"); f8=newJLabel("星期五"); f9=newJLabel("星期六"); f10=newJLabel("星期日"); box1=Box.createHorizontalBox(); box2=Box.createHorizontalBox(); box3=Box.createHorizontalBox(); box4=Box.createHorizontalBox(); box5=Box.createHorizontalBox(); box6=Box.createHorizontalBox(); box7=Box.createHorizontalBox(); box=Box.createVerticalBox(); box1.add(k1); box1.add(f1); box1.add(k2); box1.add(f2); box2.add(k3); box2.add(f3); box2.add(k4); box2.add(f4); box3.add(k5); box3.add(f5); box4.add(k6); box4.add(f6); box5.add(k7); box5.add(f7); box5.add(k8); box5.add(f8); box6.add(k9); box6.add(f9); box6.add(k10); box6.add(f10); box7.add(b1); box7.add(Box.createHorizontalStrut(20)); box7.add(b2); box.add(box1); box.add(Box.createVerticalStrut(20)); box.add(box2); box.add(Box.createVerticalStrut(20)); box.add(box3); box.add(Box.createVerticalStrut(20)); box.add(box4); box.add(Box.createVerticalStrut(20)); box.add(box5); box.add(Box.createVerticalStrut(20)); box.add(box6); box.add(Box.createVerticalStrut(20)); box.add(box7); this.add(box); b1.addActionListener(newActionListener()//拟定 { @Override publicvoidactionPerformed(ActionEvente) { //TODO自动生成办法存根 EquAltFrameframe=newEquAltFrame(); dispose(); } }); b2.addActionListener(newActionListener()//拟定 { @Override publicvoidactionPerformed(ActionEvente) { //TODO自动生成办法存根 MFrameframe=newMFrame(); dispose(); } }); }}packagekaoqin;importjavax.swing.*;importjava.awt.*;importjava.awt.event.*;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava.sql.*;classEquAltFrameextendsJFrame//修改配备信息{ publicEquAltFrame() { this.setTitle("修改配备信息"); this.setSize(400,400); this.setContentPane(newJPanel()); this.setVisible(true); this.create(); } JLabelk1,k2,k3,k4,k5,k6,k7,k8,k9,k10; JTextFieldf1,f2,f3,f4,f5,f6,f7,f8,f9,f10; Boxbox1,box2,box3,box4,box5,box6,box7,box; JButtonb1,b2; privatevoidcreate() { k1=newJLabel("上班时间:"); k2=newJLabel(":"); k3=newJLabel("下班时间:"); k4=newJLabel(":"); k5=newJLabel("每月工作总时间:"); k6=newJLabel("每月工作天数:"); k7=newJLabel("每月工作日期:"); k8=newJLabel("~"); k9=newJLabel("每月放假日期:"); k10=newJLabel("~"); b1=newJButton("保存"); b2=newJButton("取消"); f1=newJTextField(5); f2=newJTextField(5); f3=newJTextField(5); f4=newJTextField(5); f5=newJTextField(5); f6=newJTextField(5); f7=newJTextField(5); f8=newJTextField(5); f9=newJTextField(5); f10=newJTextField(5); box1=Box.createHorizontalBox(); box2=Box.createHorizontalBox(); box3=Box.createHorizontalBox(); box4=Box.createHorizontalBox(); box5=Box.createHorizontalBox(); box6=Box.createHorizontalBox(); box7=Box.createHorizontalBox(); box=Box.createVerticalBox(); box1.add(k1); box1.add(f1); box1.add(k2); box1.add(f2); box2.add(k3); box2.add(f3); box2.add(k4); box2.add(f4); box3.add(k5); box3.add(f5); box4.add(k6); box4.add(f6); box5.add(k7); box5.add(f7); box5.add(k8); box5.add(f8); box6.add(k9); box6.add(f9); box6.add(k10); box6.add(f10); box7.add(b1); box7.add(Box.createHorizontalStrut(20)); box7.add(b2); box.add(box1); box.add(Box.createVerticalStrut(20)); box.add(box2); box.add(Box.createVerticalStrut(20)); box.add(box3); box.add(Box.createVerticalStrut(20)); box.add(box4); box.add(Box.createVerticalStrut(20)); box.add(box5); box.add(Box.createVerticalStrut(20)); box.add(box6); box.add(Box.createVerticalStrut(20)); box.add(box7); this.add(box); b1.addActionListener(newActionListener()//拟定 { @Override publicvoidactionPerformed(ActionEvente) { //TODO自动生成办法存根 Equ_Framein=newEqu_Frame(); EquAltFrameon=newEquAltFrame(); in.f1.setText(on.f1.getText()); in.f2.setText(on.f2.getText()); in.f3.setText(on.f3.getText()); in.f4.setText(on.f4.getText()); in.f5.setText(on.f5.getText()); in.f6.setText(on.f6.getText()); in.f7.setText(on.f7.getText()); in.f8.setText(on.f8.getText()); in.f9.setText(on.f9.getText()); in.f10.setText(on.f10.getText()); } }); b2.addActionListener(newActionListener()//拟定 { @Override publicvoidactionPerformed(ActionEvente) { //TODO自动生成办法存根 Equ_Frameframe=newEqu_Frame(); dispose(); } }); }}packagekaoqin;importjavax.swing.*;importjava.awt.*;importjava.awt.event.*;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava.sql.*;classloginextendsJFrame//管理员登陆界面{publiclogin(){ this.setTitle("管理员登陆界面"); this.setSize(300,300);this.setContentPane(newJPanel()); this.setVisible(true);init();}JTextFieldjTextField1;JPasswordFieldjPasswordField1;privatevoidinit(){ JLabeljLabel1=newJLabel("管理员登陆"); JLabeljLabel2=newJLabel("顾客名"); JLabeljLabel3=newJLabel("密码"); jTextField1=newJTextField(10); jPasswordField1=newJPasswordField(10); JButtonbutton1=newJButton("拟定"); JButtonbutton2=newJButton("取消"); JButtonbutton3=newJButton("修改密码"); Boxbox,box1,box2,box3,box4,box5; box1=Box.createHorizontalBox(); box1.add(jLabel1); box1.add(Box.createHorizontalStrut(10)); box2=Box.createHorizontalBox(); box2.add(jLabel2); box2.add(Box.createHorizontalStrut(20)); box2.add(jTextField1); box3=Box.createHorizontalBox(); box3.add(jLabel3); box3.add(Box.createHorizontalStrut(20)); box3.add(jPasswordField1); box4=Box.createHorizontalBox(); box4.add(button1); box4.add(Box.createHorizontalStrut(20)); box4.add(button2); box5=Box.createHorizontalBox(); box5.add(button3); box=Box.createVerticalBox(); box.add(box1); box.add(Box.createVerticalStrut(20)); box.add(box2); box.add(Box.createVerticalStrut(20)); box.add(box3); box.add(Box.createVerticalStrut(20)); box.add(box4); box.add(Box.createVerticalStrut(20)); box.add(box5); this.add(box); button1.addActionListener(newActionListener(){@OverridepublicvoidactionPerformed(ActionEvente){//TODO自动生成办法存根 //loginim=newlogin(); String name=jTextField1.getText(),password=jPasswordField1.getText(); if(name.equals("admin")&&password.equals("123456")) { MFramemi=newMFrame(); dispose(); } else { JOptionPane.showMessageDialog(newJFrame("WARNING"),"顾客名或密码错误"); }}}); button2.addActionListener(newActionListener(){@OverridepublicvoidactionPerformed(ActionEvente){//TODO自动生成办法存根Main_loginframe=newMain_login();dispose();}}); button3.addActionListener(newActionListener(){@OverridepublicvoidactionPerformed(ActionEvente){//TODO自动生成办法存根 MPwdf1=newMPwd(); dispose();}});} }packagekaoqin;importjavax.swing.*;importjava.awt.*;importjava.awt.event.*;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava.sql.*;classlogin1extendsJFrame//普通顾客登陆界面{ publiclogin1() { this.setTitle("普通顾客登陆界面"); this.setSize(300,300);this.setContentPane(newJPanel()); this.setVisible(true);init(); } JTextFieldjTextField1;JPasswordFieldjPasswordField1;privatevoidinit(){ JLabeljLabel1=newJLabel("员工登陆"); JLabeljLabel2=newJLabel("顾客名"); JLabeljLabel3=newJLabel("密码"); jTextField1=newJTextField(10); jPasswordField1=newJPasswordField(10); JButtonbutton1=newJButton("拟定"); JButtonbutton2=newJButton("取消"); JButtonbutton3=newJButton("修改密码"); Boxbox,box1,box2,box3,box4,box5; box1=Box.createHorizontalBox(); box1.add(jLabel1); box1.add(Box.createHorizontalStrut(10)); box2=Box.createHorizontalBox(); box2.add(jLabel2); box2.add(Box.createHorizontalStrut(20)); box2.add(jTextField1); box3=Box.createHorizontalBox(); box3.add(jLabel3); box3.add(Box.createHorizontalStrut(20)); box3.add(jPasswordField1); box4=Box.createHorizontalBox(); box4.add(button1); box4.add(Box.createHorizontalStrut(20)); box4.add(button2); box5=Box.createHorizontalBox(); box5.add(button3); box=Box.createVerticalBox(); box.add(box1); box.add(Box.createVerticalStrut(20)); box.add(box2); box.add(Box.createVerticalStrut(20)); box.add(box3); box.add(Box.createVerticalStrut(20)); box.add(box4); box.add(Box.createVerticalStrut(20)); box.add(box5); this.add(box); button1.addActionListener(newActionListener(){@OverridepublicvoidactionPerformed(ActionEvente){//TODO自动生成办法存根 String name=jTextField1.getText(),password=jPasswordField1.getText(); if(name.equals("user")&&password.equals("123456")) { WoSerFrame2mi=newWoSerFrame2(); dispose(); } else { JOptionPane.showMessageDialog(newJFrame("WARNING"),"顾客名或密码错误"); }}}); button2.addActionListener(newActionListener(){@OverridepublicvoidactionPerformed(ActionEvente){//TODO自动生成办法存根Main_loginframe=newMain_login();dispose();}}); button3.addActionListener(newActionListener(){@OverridepublicvoidactionPerformed(ActionEvente){//TODO自动生成办法存根 MPwdf1=newMPwd(); dispose();}}); }}packagekaoqin;importjavax.swing.*;importjava.awt.*;importjava.awt.event.*;importjava.io.*;importjava.sql.*;publicclassMain_loginextendsJFrameimplementsActionListener{ publicMain_login() { super("选取顾客类型"); this.setSize(300,300); this.setContentPane(newJPanel()); create(); } privatevoidcreate() { JButtonb1,b2,b3; Boxbox1,box2,box3,box; b1=newJButton("系统管理员"); b2=newJButton("普通顾客"); b3=newJButton("退出登陆"); b1.addActionListener(this); b2.addActionListener(this); b3.addActionListener(this); box1=Box.createHorizontalBox(); box2=Box.createHorizontalBox(); box3=Box.createHorizontalBox(); box1.add(b1); box2.add(b2); box3.add(b3); box=Box.createVerticalBox(); box.add(box1); box.add(Box.createVerticalStrut(20)); box.add(box2); box.add(Box.createVerticalStrut(40)); box.add(box3); this.add(box); } publicvoidactionPerformed(ActionEvente) { if(e.getActionCommand()=="系统管理员") { loginframe=newlogin(); dispose(); } elseif(e.getActionCommand()=="普通顾客") { login1frame=newlogin1(); dispose(); } elseif(e.getActionCommand()=="退出登陆") { System.exit(0); } } publicstaticvoidmain(Stringargs[]) { //ConnectionDBmyDB=newConnectionDB(); intflag=0;//判断与否创立过数据库标志 Filefile=newFile("SQL.txt"); try{ //读入标志 FileReaderin=newFileReader(file); intlen; if((len=in.read())!=-1) flag=1;//已创立了数据库,置1 in.close(); }catch(FileNotFoundExceptione){ e.printStackTrace(); }catch(IOExceptione){ e.printStackTrace(); } //没有创立过数据库 if(flag==0){ ConnectionDBmyDB=newConnectionDB(); myDB.createTable(); myDB.breakDB(); try{ //写入标志 FileWriterout=newFileWriter(file); out.write("1"); out.close(); }catch(IOExceptione){ e.printStackTrace(); } } Main_loginframe1=newMain_login(); frame1.setVisible(true); }}packagekaoqin;importjavax.swing.*;importjava.awt.*;importjava.awt.event.*;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava.sql.*;classMFrameextendsJFrame//主功能界面{publicMFrame(){ this.setTitle("重要功能"); this.setContentPane(newJPanel()); this.setSize(350,200); this.setVisible(true); init();}privatevoidinit(){ JButtonbutton1=newJButton("员工信息管理"); JButtonbutton2=newJButton("员工出勤信息"); JButtonbutton3=newJButton("配备信息"); JButtonbutton4=newJButton("退出登陆"); Boxbox1=Box.createHorizontalBox(); Boxbox2=Box.createHorizontalBox(); Boxbox3=Box.createVerticalBox(); box1.add(button1); box1.add(Box.createHorizontalStrut(10)); box1.add(button2); box1.add(Box.createHorizontalStrut(10)); box1.add(button3); box2.add(button4); box3.add(box1); box3.add(Box.createVerticalStrut(30)); box3.add(box2); this.add(box3); button1.addActionListener(newActionListener()//{@OverridepublicvoidactionPerformed(ActionEvente){ //TODO自动生成办法存根 Worker_Frameframe=newWorker_Frame(); dispose();}}); button2.addActionListener(newActionListener()//{@OverridepublicvoidactionPerformed(ActionEvente){//TODO自动生成办法存根 AttendFrameframe=newAttendFrame();dispose();}}); button3.addActionListener(newActionListener()//{@OverridepublicvoidactionPerformed(ActionEvente){//TODO自动生成办法存根 Equ_Frameframe=newEqu_Frame(); dispose();}}); button4.addActionListener(newActionListener()//{@OverridepublicvoidactionPerformed(ActionEvente){//TODO自动生成办法存根 Main_loginframe=newMain_login(); dispose();}});}}packagekaoqin;importjavax.swing.*;importjava.awt.*;importjava.awt.event.*;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava.sql.*;classMPwdextendsJFrame//管理员密码修改{ publicMPwd() { this.setTitle("修改密码"); this.setVisible(true); this.setSize(300,200); this.setContentPane(newJPanel()); init(); } JLabelL1,L2,L3; JPasswordFieldp1,p2,p3; JButtonb1,b2; Boxbox1,box2,box3,box4,box; privatevoidinit() { L1=newJLabel("请输入原密码:"); L2=newJLabel("请输入新密码:"); L3=newJLabel("请再次输入密码:"); p1=newJPasswordField(10); p2=newJPasswordField(10); p3=newJPasswordField(10); b1=newJButton("拟定"); b2=newJButton("取消"); box1=Box.createHorizontalBox(); box1.add(L1); box1.add(Box.createHorizontalStrut(20)); box1.add(p1); box2=Box.createHorizontalBox(); box2.add(L2); box2.add(Box.createHorizontalStrut(20)); box2.add(p2); box3=Box.createHorizontalBox(); box3.add(L3); box3.add(Box.createHorizontalStrut(20)); box3.add(p3); box4=Box.createHorizontalBox(); box4.add(b1); box4.add(Box.createHorizontalStrut(20)); box4.add(b2); box=Box.createVerticalBox(); box.add(box1); box.add(Box.createVerticalStrut(10)); box.add(box2); box.add(Box.createVerticalStrut(10)); box.add(box3); box.add(Box.createVerticalStrut(10)); box.add(box4); this.add(box1); this.add(box2); this.add(box3); this.add(box4); this.add(box); b1.addActionListener(newActionListener()//拟定 { @Override publicvoidactionPerformed(ActionEvente) { //TODO自动生成办法 if(p1.getText().equals("123456")) { if(p2.getText().equals(p3.getText())) { JOptionPane.showMessageDialog(newJFrame("WARNING"),"密码修改成功"); loginframe=newlogin(); dispose(); } else { JOptionPane.showMessageDialog(newJFrame("WARNING"),"两次密码输入不一致,请重新输入"); } } else { JOptionPane.showMessageDialog(newJFrame("WARNING"),"原密码输入不对的,请重新输入"); } } }); b2.addActionListener(newActionListener()//拟定 { @Override publicvoidactionPerformed(ActionEvente) { //TODO自动生成办法存根 Main_loginframe=newMain_login(); dispose(); } }); } }packagekaoqin;importjavax.swing.*;importjava.awt.*;importjava.awt.event.*;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava.sql.*;classOperatSFrameextendsJFrame//提示类{privateJLabeldisplayLabel;privatestaticFontfont=newFont("楷体",Font.BOLD,14);publicOperatSFrame(){this.setSize(300,100);this.setLayout(null);this.setResizable(false);this.setVisible(true);this.addCompnents();}privatevoidaddCompnents(){displayLabel=newJLabel("操作成功!");displayLabel.setFont(font);displayLabel.setBounds(80,30,100,30);this.add(displayLabel);}}packagekaoqin;importjavax.swing.*;importjava.awt.*;importjava.awt.event.*;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava.sql.*;classUBoundFrameextendsJFrame//非弹性工作制{ publicUBoundFrame() { this.setTitle("非弹性工作制"); this.setVisible(true); this.setContentPane(newJPanel()); this.setSize(400,400); create(); } JLabelk1,k2,k3,k4,k5,k6,k7,k8,k9,k10; JTextFieldf1,f2,f3,f4,f5,f6,f7,f8,f9,f10; Boxbox1,box2,box3,box4,box5,box6,box7,box; JButtonb1; privatevoidcreate() { k1=newJLabel("工号:"); k2=newJLabel("姓名:"); k3=newJLabel("进入时间:"); k4=newJLabel(":"); k5=newJLabel("离开时间:"); k6=newJLabel(":"); k7=newJLabel("工作时间:"); k8=newJLabel(":"); k9=newJLabel("早退次数:"); k10=newJLabel("迟到次数:"); b1=newJButton("返回"); f1=newJTextField(5); f2=newJTextField(5); f3=newJTextField(5); f4=newJTextField(5); f5=newJTextField(5); f6=newJTextField(5); f7=newJTextField(5); f8=newJTextField(5); f9=newJTextField(5); f10=newJTextField(5); box1=Box.createHorizontalBox(); box2=Box.createHorizontalBox(); box3=Box.createHorizontalBox(); box4=Box.createHorizontalBox(); box5=Box.createHorizontalBox(); box6=Box.createHorizontalBox(); box7=Box.createHorizontalBox(); box=Box.createVerticalBox(); box1.add(k1); box1.add(f1); box1.add(Box.createHorizontalStrut(20)); box1.add(k2); box1.add(f2); box2.add(k3); box2.add(f3); box2.add(k4); box2.ad

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论