java教师工资管理系统完整代码.docx
- 文档编号:2783608
- 上传时间:2022-11-15
- 格式:DOCX
- 页数:78
- 大小:539.38KB
java教师工资管理系统完整代码.docx
《java教师工资管理系统完整代码.docx》由会员分享,可在线阅读,更多相关《java教师工资管理系统完整代码.docx(78页珍藏版)》请在冰豆网上搜索。
java教师工资管理系统完整代码
教师工资管理系统:
开发团队:
206和207
时间:
2012年4月8日
数据库配置:
sqlserver2000
创建数据库SalaryManagement在其下创建数据表logindata、
创建数据表Employee
创建数据表January
创建数据表February
创建数据表March
创建数据库April
创建数据表May
创建数据表June
创建数据表July
创建数据表August
创建数据表September
创建数据表October
创建数据表November
创建数据表December
开发工具JDK1.6.21和eclipse,数据库驱动jdbc配置和导入省略。
程序代码如下
importjava.awt.BorderLayout;
importjava.awt.Dimension;
importjava.awt.FlowLayout;
importjava.awt.Font;
importjava.awt.GridLayout;
importjava.awt.Toolkit;
importjava.awt.event.ActionEvent;
importjava.awt.event.ActionListener;
importjava.awt.event.WindowAdapter;
importjava.awt.event.WindowEvent;
importjavax.swing.ButtonGroup;
importjavax.swing.JButton;
importjavax.swing.JDialog;
importjavax.swing.JFrame;
importjavax.swing.JLabel;
importjavax.swing.JOptionPane;
importjavax.swing.JPanel;
importjavax.swing.JPasswordField;
importjavax.swing.JRadioButton;
importjavax.swing.JTextField;
publicclassLoginextendsJFrame{
privateJLabellbTitle,lbUser,lbPwd;
privateJButtonbtnLogon,btnOK,btnExit;
privateBooleanlean=null;
JTextFieldtfUser=newJTextField(15);
JPasswordFieldtfPwd=newJPasswordField(15);
JRadioButtonradiobutton1=newJRadioButton("教师登陆");
JRadioButtonradiobutton2=newJRadioButton("管理登陆");
ButtonGroupbuttongroup=newButtonGroup();
Stringusername=tfUser.getText();
Stringpassword=newString(tfPwd.getPassword());
publicLogin(){
try{init();}catch(Exceptione3){
e3.printStackTrace();
}
}
publicvoidinit(){
this.setTitle("登陆界面");
this.setBounds(450,300,400,300);
JPanelp=newJPanel(newBorderLayout());
p.setBounds(0,0,500,400);
JPanelp1=newJPanel(newFlowLayout());
JPanelp2=newJPanel(newGridLayout(2,1));
JPanelp21=newJPanel(newFlowLayout());
JPanelp22=newJPanel(newFlowLayout());
JPanelp3=newJPanel(newFlowLayout());
buttongroup.add(radiobutton1);
buttongroup.add(radiobutton2);
this.lbUser=newJLabel("用户名:
");
this.lbPwd=newJLabel("密码:
");
this.tfUser=newJTextField(15);
this.tfPwd=newJPasswordField(15);
this.tfPwd.setEchoChar('*');
this.btnLogon=newJButton("注册");
this.btnOK=newJButton("登录");
this.btnExit=newJButton("退出");
this.btnLogon.addActionListener(newActionMonitor());
this.btnOK.addActionListener(newActionMonitor());
this.btnExit.addActionListener(newActionMonitor());
p1.add(radiobutton1);
p1.add(radiobutton2);
p21.add(this.lbUser);
p21.add(this.tfUser);
p22.add(this.lbPwd);
p22.add(this.tfPwd);
p3.add(btnLogon);
p3.add(this.btnOK);
p3.add(this.btnExit);
p2.add(p21);
p2.add(p22);
p.add(p1,BorderLayout.NORTH);
p.add(p2,BorderLayout.CENTER);
p.add(p3,BorderLayout.SOUTH);
p.setVisible(true);
this.add(p);
this.pack();
this.setVisible(true);
this.addWindowListener(newWindowMonitor());
}
classWindowMonitorextendsWindowAdapter{
publicvoidwindowClosing(WindowEvente){
setVisible(false);
System.exit(0);
}
}
classActionMonitorimplementsActionListener{
publicvoidactionPerformed(ActionEvente){
try{
if(e.getSource()==btnOK){
if(radiobutton2.isSelected()){
ManageUseruser1=newManageUser();
user1.setName(tfUser.getText());
user1.setPassword(newString(tfPwd.getPassword()));
ManageCheckar1=newManageCheck(user1);
if(ar1.check()){
newManagementFrame().setVisible(true);
}else{
JOptionPane.showMessageDialog(null,"账号或密码错误","警告",JFrame.EXIT_ON_CLOSE);
tfUser.setText("");
tfPwd.setText("");
}
}elseif(radiobutton1.isSelected()){
Useruser=newUser();
user.setUserName(tfUser.getText());
user.setPassWord(newString(tfPwd.getPassword()));
ActionCheckar=newActionCheck(user);
if(ar.check()){
newTeacherFrame().setVisible(true);
}else{
JOptionPane.showMessageDialog(null,"账号或密码错误","警告",JFrame.EXIT_ON_CLOSE);
tfUser.setText("");
tfPwd.setText("");
}
}
}
elseif(e.getSource()==btnExit){
setVisible(false);
System.exit(0);
}
elseif(e.getSource()==btnLogon){
newLogonFrame().setVisible(true);
}
}
catch(Exceptione2){
e2.printStackTrace();
}
}
}
publicstaticvoidmain(String[]args){
Loginframe=newLogin();
DimensionscreenSize=Toolkit.getDefaultToolkit().getScreenSize();
DimensionframeSize=frame.getSize();
if(frameSize.height>screenSize.height)
frameSize.height=screenSize.height;
if(frameSize.width>screenSize.width)
frameSize.width=screenSize.width;
frame.setLocation((screenSize.width-frameSize.width)/2,(screenSize.height-frameSize.height)/2);
frame.setVisible(true);
}
}
importjava.awt.*;
importjava.sql.*;
importjavax.swing.*;
importjava.awt.event.*;
publicclassLogonFrameextendsJFrame{
Connectioncon;
Statementst;
JLabeljLabel1=newJLabel("职工工号");
JLabeljLabel2=newJLabel("登陆密码");
JLabeljLabel3=newJL
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- java 教师工资 管理 系统 完整 代码
![提示](https://static.bdocx.com/images/bang_tan.gif)