java教师工资管理系统完整代码

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

教师工资管理系统:

开发团队: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配置和导入省略。程序代码如下

import java.awt.BorderLayout;

import java.awt.Dimension;

import java.awt.FlowLayout;

import java.awt.Font;

import java.awt.GridLayout;

import java.awt.Toolkit;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.awt.event.WindowAdapter;

import java.awt.event.WindowEvent;

import javax.swing.ButtonGroup;

import javax.swing.JButton;

import javax.swing.JDialog;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JOptionPane;

import javax.swing.JPanel;

import javax.swing.JPasswordField;

import javax.swing.JRadioButton;

import javax.swing.JTextField;

public class Login extends JFrame{

private JLabel lbTitle, lbUser, lbPwd;

private JButton btnLogon,btnOK, btnExit;

private Boolean lean=null;

JTextField tfUser = new JTextField(15);

JPasswordField tfPwd = new JPasswordField(15);

JRadioButton radiobutton1=new JRadioButton("教师登陆");

JRadioButton radiobutton2=new JRadioButton("管理登陆");

ButtonGroup buttongroup=new ButtonGroup();

String username=tfUser.getText();

String password=new String(tfPwd.getPassword());

public Login(){

try{init();}catch(Exception e3){

e3.printStackTrace();

}

}

public void init() {

this.setTitle("登陆界面");

this.setBounds(450, 300, 400, 300);

JPanel p = new JPanel(new BorderLayout());

p.setBounds(0, 0, 500, 400);

JPanel p1 = new JPanel(new FlowLayout());

JPanel p2 = new JPanel(new GridLayout(2,1));

JPanel p21 = new JPanel(new FlowLayout());

JPanel p22 = new JPanel(new FlowLayout());

JPanel p3 = new JPanel(new FlowLayout());

buttongroup.add(radiobutton1);

buttongroup.add(radiobutton2);

this.lbUser = new JLabel(" 用户名:");

this.lbPwd = new JLabel("密码:");

this.tfUser = new JTextField(15);

this.tfPwd = new JPasswordField(15);

this.tfPwd.setEchoChar('*');

this.btnLogon=new JButton("注册");

this.btnOK = new JButton(" 登录");

this.btnExit = new JButton("退出");

this.btnLogon.addActionListener(new ActionMonitor());

this.btnOK.addActionListener(new ActionMonitor());

this.btnExit.addActionListener(new ActionMonitor());

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(new WindowMonitor());

}

class WindowMonitor extends WindowAdapter {

public void windowClosing(WindowEvent e) {

setVisible(false);

System.exit(0);

}

}

class ActionMonitor implements ActionListener {

public void actionPerformed(ActionEvent e) {

try{

相关文档
最新文档