员工出勤管理系统 java图形化界面设计.docx

上传人:b****6 文档编号:3930405 上传时间:2022-11-26 格式:DOCX 页数:40 大小:400.25KB
下载 相关 举报
员工出勤管理系统 java图形化界面设计.docx_第1页
第1页 / 共40页
员工出勤管理系统 java图形化界面设计.docx_第2页
第2页 / 共40页
员工出勤管理系统 java图形化界面设计.docx_第3页
第3页 / 共40页
员工出勤管理系统 java图形化界面设计.docx_第4页
第4页 / 共40页
员工出勤管理系统 java图形化界面设计.docx_第5页
第5页 / 共40页
点击查看更多>>
下载资源
资源描述

员工出勤管理系统 java图形化界面设计.docx

《员工出勤管理系统 java图形化界面设计.docx》由会员分享,可在线阅读,更多相关《员工出勤管理系统 java图形化界面设计.docx(40页珍藏版)》请在冰豆网上搜索。

员工出勤管理系统 java图形化界面设计.docx

员工出勤管理系统java图形化界面设计

 

一、设计目的………………………………………………………………2

二、功能介绍………………………………………………………………2

三、程序流程………………………………………………………………2

四、设计步骤………………………………………………………………3

五、设计总结………………………………………………………………7

六、程序清单………………………………………………………………7

 

一、设计目的

通过课程设计,使自己提高理论联系实际解决实际问题的能力;也使自己对基于面向对象的理论进行系统设计过程中的诸多具体问题有感性的认识和深入的理解;进而提高自己的学习兴趣为其将来顺利进入毕业环节作必要的准备。

按照教师给出的思路和计划进度安排独立完成课程设计

二、功能介绍

1、具有新用户注册功能。

2、具有注册用户登录功能。

3、具有员工信息的录入功能。

4、具有员工出勤信息的录入功能。

5、具有数据查询功能,可以实现查询全部信息和按条件执行查询。

6、具有按条件删除数据功能。

7、具有统计功能

8、.本程序采用RCP技术,和SQL数据库。

三.程序流程

四、设计步骤

(一)程序设计步骤

1.建立RCP工程并构建数据库

2.建立RCP工程需要的view和editor

3.构建基本框架,并主要修改Perspective和WorkbenchWindowAdvisor两个文件

4.构建需要的辅助文件

5.测试

(二)图片说明:

1.登录窗口和注册窗口

 

2.菜单部分

3.功能实现模块

查询所有人的出勤情况

修改出勤情况

增加新的员工信息

删除不用的信息

管理员密码修改

(三)数据库设计

员工出勤表

管理员表

五、设计总结

经过将近一周的课程设计,对java有了更深一层次的认识,感觉java很强大。

虽然系统的基本功能都已实现,但还是存在系统不稳定等多个问题尚待解决。

这个系统主要是我自己开发的,但也得到了老师和同学的很大帮助。

我正在做系统的过程中遇到了很多问题,有的是知识存储不足,有的是考虑不够周全,之所以能够顺利实现基本功功能,离不开老师和同学的大力相助。

事实证明,只靠自己是不能顺利完成一套功能完整的系统的,必须充分利用团队的力量。

开发一套系统,最重要的是细心,并不是一定要做到面面俱到,但也要充分考虑到客户的需求和现实意义,不管什么系统,只用运用到实际应用中,才具有先现实意义。

所以在准备工作中要正确分析社会需求了解现实应用,画出流程图,把大体框架做好,然后再逐一细化。

我们不可能做到面面俱到,但一定要做到步步扎实,作为一个程序编程人员,要保持清醒的头脑,以现实为依据,让自己的每一行代码都能实现自己的意义。

通过这次课程设计,我收获的不仅仅是课程上的知识得到实际应用,还有编程的基本习惯和开发系统时应注意的流程。

虽然课程设计结束了,但是java的学习却没有结束,以后更加努力的。

六.部分主要程序清单

1.RCP中需要修改的ApplicationWorkbenchAdvisor文件

importorg.eclipse.swt.SWT;

importorg.eclipse.swt.widgets.Display;

importorg.eclipse.ui.application.IWorkbenchWindowConfigurer;

importorg.eclipse.ui.application.WorkbenchAdvisor;

importorg.eclipse.ui.application.WorkbenchWindowAdvisor;

importviews.Loginshell;

publicclassApplicationWorkbenchAdvisorextendsWorkbenchAdvisor{

privatestaticfinalStringPERSPECTIVE_ID="rsgl.perspective";

publicstaticbooleantag=false;

publicWorkbenchWindowAdvisorcreateWorkbenchWindowAdvisor(IWorkbenchWindowConfigurerconfigurer){

try{

Displaydisplay=Display.getDefault();

Loginshellshell=newLoginshell(display,SWT.SHELL_TRIM);

shell.open();

shell.layout();

while(!

shell.isDisposed()){

if(!

display.readAndDispatch())

display.sleep();

}

}catch(Exceptione){

e.printStackTrace();

}

if(tag){

returnnewApplicationWorkbenchWindowAdvisor(configurer);

}else{

returnnull;

}

}

publicStringgetInitialWindowPerspectiveId(){

returnPERSPECTIVE_ID;

}

}

2.RCP中需要修改的Perspective文件

importorg.eclipse.ui.IPageLayout;

importorg.eclipse.ui.IPerspectiveFactory;

importviews.Menus;

importviews.MyInfo;

publicclassPerspectiveimplementsIPerspectiveFactory{

publicvoidcreateInitialLayout(IPageLayoutlayout){

layout.addView(Menus.ID,IPageLayout.LEFT,0.45f,layout.getEditorArea());

layout.addView(MyInfo.ID,IPageLayout.BOTTOM,0.6f,Menus.ID);

}

}

3.功能部分程序

3.1用户注册

publicclassLoginShellextendsShell{

privateTexttext_2;

privateTexttext_1;

privateTexttext;

publicstaticvoidmain(Stringargs[]){

try{

Displaydisplay=Display.getDefault();

LoginShellshell=newLoginShell(display,SWT.SHELL_TRIM);

shell.open();

shell.layout();

while(!

shell.isDisposed()){

if(!

display.readAndDispatch())

display.sleep();

}

}catch(Exceptione){

e.printStackTrace();

}

}

publicLoginShell(Displaydisplay,intstyle){

super(display,style);

createContents();

setBackgroundImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/4ddf962769045c6b8b82a188.jpg"));

setBackground(SWTResourceManager.getColor(255,255,255));

setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/4ddf962769045c6b8b82a188.jpg"));

setBackgroundMode(SWT.INHERIT_DEFAULT);

setText("用户登陆");

}

protectedvoidcreateContents(){

setSize(507,400);

finalLabellabel=newLabel(this,SWT.NONE);

label.setBackground(SWTResourceManager.getColor(255,255,255));

label.setText("登录名:

");

label.setBounds(148,195,47,17);

text=newText(this,SWT.BORDER);

text.setBounds(220,192,116,20);

finalLabellabel1=newLabel(this,SWT.NONE);

label1.setBackground(SWTResourceManager.getColor(255,255,255));

label1.setText("密码:

");

label1.setBounds(148,235,39,17);

text_1=newText(this,SWT.BORDER|SWT.PASSWORD);

finalLabellabel4=newLabel(this,SWT.NONE);

text_1.addMouseListener(newMouseAdapter(){

publicvoidmouseDown(finalMouseEvente){

label4.setBackground(SWTResourceManager.getColor(255,255,255));

if(text.getText().trim()!

=""){

label4.setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/4.PNG"));

}else{

label4.setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/3.PNG"));

}

label4.setBounds(342,195,23,17);

}

});

text_1.setBounds(220,232,116,20);

finalLabellabel2=newLabel(this,SWT.NONE);

label2.setBackground(SWTResourceManager.getColor(255,255,255));

label2.setText("验证码:

");

label2.setBounds(148,274,47,17);

text_2=newText(this,SWT.BORDER);

finalLabellabel3=newLabel(this,SWT.NONE);

label3.setForeground(SWTResourceManager.getColor(255,0,0));

label3.setFont(SWTResourceManager.getFont("@方正舒体",18,SWT.BOLD,true,false));

finalLabellabel4_1=newLabel(this,SWT.NONE);

text_2.addMouseListener(newMouseAdapter(){

publicvoidmouseDown(finalMouseEvente){

String[]a2={"0","1","2","3","4","5","6","7","8",

"9","a","b","c","d","e","f","g","h","i","j",

"k","l","m","n","o","p","q","r","s","t","u",

"v","w","x","y","z"};

Randomr=newRandom();

Stringresult="";

while(result.length()<4){

inttemp=r.nextInt(36);

result=result+a2[temp];

}

label3.setText(result);

System.out.println(label3.getText());

label4_1.setBackground(SWTResourceManager.getColor(255,255,255));//获取label的背景色

if(text_1.getText().trim()!

=""){

label4_1.setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/4.PNG"));

}else{

label4_1.setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/3.PNG"));

}

label4_1.setBounds(342,235,23,17);

label3.setBackground(SWTResourceManager.getColor(255,255,255));

label3.setBounds(386,271,72,27);

}

});

text_2.setBounds(220,271,116,20);

finalButtonbutton=newButton(this,SWT.NONE);

finalLabellabel4_2=newLabel(this,SWT.NONE);

button.addSelectionListener(newSelectionAdapter(){

publicvoidwidgetSelected(finalSelectionEvente){

System.out.println(text_2.getText());

if(text_1.getText().trim()!

=""&&text_2.getText().equals(label3.getText())){

label4_2.setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/4.PNG"));

}else{

label4_2.setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/3.PNG"));

}

label4_2.setBounds(342,274,23,17);

label4_2.setText("");

Stringname=text.getText();

Stringpassword=text_1.getText();

Stringsql="select*fromuserswherename='"+name+"'";

DBHelperdb=newDBHelper();

ResultSetrs=db.query(sql);

try{

if(rs.next()){

StringpasswordQ=rs.getString("password");

if(passwordQ.equals(password)&&text_2.getText().equals(label3.getText())){

ApplicationWorkbenchAdvisor.tag=true;

Property.NAME=rs.getString("name");

Property.PASSWORD=rs.getString("password");

Property.ID=rs.getString("uid");

MessageDialog.openInformation(LoginShell.this,"登录成功","登录成功");

LoginShell.this.dispose();

}else{

MessageDialog.openError(LoginShell.this,"登录失败","登录失败,密码或者验证码错误!

");

}

}else{

MessageDialog.openError(LoginShell.this,"登录失败","登录失败,不存在该用户!

");

}

}catch(SQLExceptione1){

e1.printStackTrace();

}

db.close();

}

});

button.setBackground(SWTResourceManager.getColor(255,255,255));

button.setText("登陆");

button.setBounds(272,325,64,27);

}

@Override

protectedvoidcheckSubclass(){

//DisablethecheckthatpreventssubclassingofSWTcomponents

}

}

3.2用户注册

publicclassZhuceextendsEditorPart{

publicstaticfinalStringID="editors.Zhuce";//$NON-NLS-1$

privateTexttext2;

privateTexttext1;

privateTexttext3;

protectedstaticfinalShellShell=null;

@Override

publicvoidcreatePartControl(Compositeparent){

Compositecontainer=newComposite(parent,SWT.NONE);

container.setBackgroundImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/4ddf962769045c6b8b82a188.jpg"));

container.setBackground(SWTResourceManager.getColor(255,255,255));

finalLabellabel=newLabel(container,SWT.WRAP);

label.setBackground(SWTResourceManager.getColor(255,255,255));

label.setText("姓名:

");

label.setBounds(350,150,64,17);

finalLabellabel2=newLabel(container,SWT.NONE);

label2.setBackground(SWTResourceManager.getColor(255,255,255));

label2.setText("密码:

");

label2.setBounds(350,190,50,17);

finalLabellabel3=newLabel(container,SWT.NONE);

label3.setBackground(SWTResourceManager.getColor(255,255,255));

label3.setText("确认密码:

");

label3.setBounds(350,230,50,17);

text1=newText(container,SWT.BORDER);

text1.setBounds(450,150,155,23);

text2=newText(container,SWT.BORDER);

text2.addMouseListener(newMouseAdapter(){

publicvoidmouseDown(finalMouseEvente){

if(text1.getText().trim()==""){

MessageDialog.openError(Shell,"提示!

","姓名不能为空!

");

}

}

});

text2.setBounds(450,190,155,23);

text3=newText(container,SWT.BORDER);

text3.addMouseListener(newMouseAdapter(){

publicvoidmouseDown(finalMouseEvente){

if(text2.ge

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

当前位置:首页 > 外语学习 > 英语学习

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1