課程設(shè)計(jì)考勤管理系統(tǒng)源代碼樣本_第1頁(yè)
課程設(shè)計(jì)考勤管理系統(tǒng)源代碼樣本_第2頁(yè)
課程設(shè)計(jì)考勤管理系統(tǒng)源代碼樣本_第3頁(yè)
課程設(shè)計(jì)考勤管理系統(tǒng)源代碼樣本_第4頁(yè)
課程設(shè)計(jì)考勤管理系統(tǒng)源代碼樣本_第5頁(yè)
已閱讀5頁(yè),還剩81頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

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//工作制類(lèi)型{ publicAttendFrame() { this.setTitle("工作制類(lèi)型"); 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自動(dòng)生成辦法存根 UBoundFrameframe=newUBoundFrame(); dispose(); } }); b2.addActionListener(newActionListener()// { @Override publicvoidactionPerformed(ActionEvente) { //TODO自動(dòng)生成辦法存根 BoundFrameframe=newBoundFrame(); dispose(); } }); b3.addActionListener(newActionListener()// { @Override publicvoidactionPerformed(ActionEvente) { //TODO自動(dòng)生成辦法存根 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("工號(hào):"); k2=newJLabel("姓名:"); k3=newJLabel("當(dāng)月工時(shí):"); k4=newJLabel(":"); k5=newJLabel("當(dāng)月工作天數(shù)"); k6=newJLabel("當(dāng)月富余:"); 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自動(dòng)生成辦法存根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("上班時(shí)間:"); k2=newJLabel(":"); k3=newJLabel("下班時(shí)間:"); k4=newJLabel(":"); k5=newJLabel("每月工作總時(shí)間:"); k6=newJLabel("每月工作天數(shù):"); 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自動(dòng)生成辦法存根 EquAltFrameframe=newEquAltFrame(); dispose(); } }); b2.addActionListener(newActionListener()//擬定 { @Override publicvoidactionPerformed(ActionEvente) { //TODO自動(dòng)生成辦法存根 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("上班時(shí)間:"); k2=newJLabel(":"); k3=newJLabel("下班時(shí)間:"); k4=newJLabel(":"); k5=newJLabel("每月工作總時(shí)間:"); k6=newJLabel("每月工作天數(shù):"); 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自動(dòng)生成辦法存根 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自動(dòng)生成辦法存根 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自動(dòng)生成辦法存根 //loginim=newlogin(); String name=jTextField1.getText(),password=jPasswordField1.getText(); if(name.equals("admin")&&password.equals("123456")) { MFramemi=newMFrame(); dispose(); } else { JOptionPane.showMessageDialog(newJFrame("WARNING"),"顧客名或密碼錯(cuò)誤"); }}}); button2.addActionListener(newActionListener(){@OverridepublicvoidactionPerformed(ActionEvente){//TODO自動(dòng)生成辦法存根Main_loginframe=newMain_login();dispose();}}); button3.addActionListener(newActionListener(){@OverridepublicvoidactionPerformed(ActionEvente){//TODO自動(dòng)生成辦法存根 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自動(dòng)生成辦法存根 String name=jTextField1.getText(),password=jPasswordField1.getText(); if(name.equals("user")&&password.equals("123456")) { WoSerFrame2mi=newWoSerFrame2(); dispose(); } else { JOptionPane.showMessageDialog(newJFrame("WARNING"),"顧客名或密碼錯(cuò)誤"); }}}); button2.addActionListener(newActionListener(){@OverridepublicvoidactionPerformed(ActionEvente){//TODO自動(dòng)生成辦法存根Main_loginframe=newMain_login();dispose();}}); button3.addActionListener(newActionListener(){@OverridepublicvoidactionPerformed(ActionEvente){//TODO自動(dòng)生成辦法存根 MPwdf1=newMPwd(); dispose();}}); }}packagekaoqin;importjavax.swing.*;importjava.awt.*;importjava.awt.event.*;importjava.io.*;importjava.sql.*;publicclassMain_loginextendsJFrameimplementsActionListener{ publicMain_login() { super("選取顧客類(lèi)型"); this.setSize(300,300); this.setContentPane(newJPanel()); create(); } privatevoidcreate() { JButtonb1,b2,b3; Boxbox1,box2,box3,box; b1=newJButton("系統(tǒng)管理員"); 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()=="系統(tǒng)管理員") { loginframe=newlogin(); dispose(); } elseif(e.getActionCommand()=="普通顧客") { login1frame=newlogin1(); dispose(); } elseif(e.getActionCommand()=="退出登陸") { System.exit(0); } } publicstaticvoidmain(Stringargs[]) { //ConnectionDBmyDB=newConnectionDB(); intflag=0;//判斷與否創(chuàng)立過(guò)數(shù)據(jù)庫(kù)標(biāo)志 Filefile=newFile("SQL.txt"); try{ //讀入標(biāo)志 FileReaderin=newFileReader(file); intlen; if((len=in.read())!=-1) flag=1;//已創(chuàng)立了數(shù)據(jù)庫(kù),置1 in.close(); }catch(FileNotFoundExceptione){ e.printStackTrace(); }catch(IOExceptione){ e.printStackTrace(); } //沒(méi)有創(chuàng)立過(guò)數(shù)據(jù)庫(kù) if(flag==0){ ConnectionDBmyDB=newConnectionDB(); myDB.createTable(); myDB.breakDB(); try{ //寫(xiě)入標(biāo)志 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自動(dòng)生成辦法存根 Worker_Frameframe=newWorker_Frame(); dispose();}}); button2.addActionListener(newActionListener()//{@OverridepublicvoidactionPerformed(ActionEvente){//TODO自動(dòng)生成辦法存根 AttendFrameframe=newAttendFrame();dispose();}}); button3.addActionListener(newActionListener()//{@OverridepublicvoidactionPerformed(ActionEvente){//TODO自動(dòng)生成辦法存根 Equ_Frameframe=newEqu_Frame(); dispose();}}); button4.addActionListener(newActionListener()//{@OverridepublicvoidactionPerformed(ActionEvente){//TODO自動(dòng)生成辦法存根 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("請(qǐng)輸入原密碼:"); L2=newJLabel("請(qǐng)輸入新密碼:"); L3=newJLabel("請(qǐng)?jiān)俅屋斎朊艽a:"); 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自動(dòng)生成辦法 if(p1.getText().equals("123456")) { if(p2.getText().equals(p3.getText())) { JOptionPane.showMessageDialog(newJFrame("WARNING"),"密碼修改成功"); loginframe=newlogin(); dispose(); } else { JOptionPane.showMessageDialog(newJFrame("WARNING"),"兩次密碼輸入不一致,請(qǐng)重新輸入"); } } else { JOptionPane.showMessageDialog(newJFrame("WARNING"),"原密碼輸入不對(duì)的,請(qǐng)重新輸入"); } } }); b2.addActionListener(newActionListener()//擬定 { @Override publicvoidactionPerformed(ActionEvente) { //TODO自動(dòng)生成辦法存根 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//提示類(lèi){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("工號(hào):"); k2=newJLabel("姓名:"); k3=newJLabel("進(jìn)入時(shí)間:"); k4=newJLabel(":"); k5=newJLabel("離開(kāi)時(shí)間:"); k6=newJLabel(":"); k7=newJLabel("工作時(shí)間:"); k8=newJLabel(":"); k9=newJLabel("早退次數(shù):"); k10=newJLabel("遲到次數(shù):"); 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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論