login GUI界面(登录)

package 普通员工管理系统;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPasswordField;
import javax.swing.JTextField; public class Login extends JFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
private JLabel userlabel =new JLabel("用户名:");
private JLabel passwordlabel = new JLabel("密码:");
private JTextField usertext = new JTextField();
private JPasswordField passwordtext = new JPasswordField();
private JButton but1 = new JButton("确定");
private JButton but2 = new JButton("取消"); public Login()
{
this.setSize(500, 300);
this.setLocation(200, 200);
this.setTitle("用户登录"); this.setLayout(null);
userlabel.setBounds(120, 20, 50, 30);
passwordlabel.setBounds(120, 100, 50, 30);
usertext.setBounds(200, 20, 150, 30);
passwordtext.setBounds(200, 100, 150, 30);
but1.setBounds(150, 150, 80, 30);
but2.setBounds(250, 150, 80, 30);
this.add(userlabel);
this.add(passwordlabel);
this.add(usertext);
this.add(passwordtext);
this.add(but1);
this.add(but2); but1.addActionListener(new ActionListener() { @Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
String name = usertext.getText(); //获取文本框数据
String password = new String(passwordtext.getPassword()); //获取密码框数据
if("admin".equals(name)&&"123".equals(password)) //判断
{
JOptionPane.showMessageDialog(null, "真牛逼,密码对了"); //弹出消息框
}
else {
JOptionPane.showMessageDialog(null, "用户名或错误"); //弹出消息框
usertext.setText("");
passwordtext.setText("");
}
}
});
passwordtext.addActionListener(new ActionListener() { @Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
String name = usertext.getText(); //获取文本框数据
String password = new String(passwordtext.getPassword()); //获取密码框数据
if("admin".equals(name)&&"123".equals(password)) //判断
{
new Home();
JOptionPane.showMessageDialog(null, "真牛逼,密码对了"); //弹出消息框 Login.this.dispose();
}
else {
JOptionPane.showMessageDialog(null, "用户名或错误"); //弹出消息框
usertext.setText("");
passwordtext.setText("");
}
}
});
this.setVisible(true);
} public static void main(String[] args) {
// TODO Auto-generated method stub
new Login(); } }

Home GUI界面(主界面)

package 普通员工管理系统;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem; public class Home extends JFrame { /**
*
*/
private static final long serialVersionUID = -1131044405944264320L; public Home()
{
this.setSize(600, 400);
this.setLocation(200, 200);
this.setTitle("普通员工界面"); //创建菜单栏
JMenuBar mbr = new JMenuBar(); //菜单栏
this.setJMenuBar(mbr); //添加菜单栏到容器 //创建菜单
JMenu men = new JMenu("功能管理"); //菜单
JMenu men1 = new JMenu("系统管理");
mbr.add(men); //添加菜单到菜单栏
mbr.add(men1); //创建菜单项
JMenuItem ltem1 = new JMenuItem("查看个人信息"); //菜单项
JMenuItem ltem2 = new JMenuItem("汇报工作");
JMenuItem ltem3 = new JMenuItem("修改密码");
JMenuItem ltem4 = new JMenuItem("查看测评成绩"); JMenuItem ltem5 = new JMenuItem("登录");
JMenuItem ltem6 = new JMenuItem("问卷");
men.add(ltem1); //添加菜单项到菜单
men.add(ltem2);
men.add(ltem3);
men.add(ltem4);
men1.add(ltem5);
men1.add(ltem6);
//创建菜单项事件
ltem1.addActionListener(new ActionListener() { @Override
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
new Information();
//setVisible(false);
}
}); ltem2.addActionListener(new ActionListener() { @Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
new Work();
//setVisible(false);
}
}); ltem3.addActionListener(new ActionListener() { @Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
new Password();
//setVisible(false);
}
}); ltem4.addActionListener(new ActionListener() { @Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
new Achievement();
//setVisible(false); }
});
ltem5.addActionListener(new ActionListener() { @Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
new Login();
setVisible(false);
}
});
ltem6.addActionListener(new ActionListener() { @Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
//setVisible(false);
new Questionnaire();
}
});
this.setVisible(true);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new Home();
} }

Information GUI界面(个人信息)

package 普通员工管理系统;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField; public class Information extends JFrame { /**
*
*/
private static final long serialVersionUID = 1L;
private JLabel l1 = new JLabel("编号:");
private JLabel l2 = new JLabel("姓名:");
private JLabel l3 = new JLabel("性别:");
private JLabel l4 = new JLabel("级别:");
private JLabel l5 = new JLabel("部门:");
private JLabel l6 = new JLabel("薪资:"); private JTextField t1 = new JTextField("0007");
private JTextField t2 = new JTextField("刘强");
private JTextField t3 = new JTextField("女");
private JTextField t4 = new JTextField("普通用户");
private JTextField t5 = new JTextField("技术部");
private JTextField t6 = new JTextField("4000.0"); public Information()
{
this.setSize(600, 400);
this.setLocation(200, 200);
this.setTitle("查看个人信息");
this.setLayout(null);
l1.setBounds(100, 20, 50, 30);
l2.setBounds(100, 60, 50, 30);
l3.setBounds(100, 100, 50, 30);
l4.setBounds(100, 140, 50, 30);
l5.setBounds(100, 180, 50, 30);
l6.setBounds(100, 220, 50, 30); t1.setBounds(200, 25, 250, 20);
t2.setBounds(200, 65, 250, 20);
t3.setBounds(200, 105, 250, 20);
t4.setBounds(200, 145, 250, 20);
t5.setBounds(200, 185, 250, 20);
t6.setBounds(200, 225, 250, 20); this.add(l1);
this.add(l2);
this.add(l3);
this.add(l4);
this.add(l5);
this.add(l6);
this.add(t1);
this.add(t2);
this.add(t3);
this.add(t4);
this.add(t5);
this.add(t6);
this.setVisible(true);
} public static void main(String[] args) {
// TODO Auto-generated method stub
new Information(); } }

Work GUI界面(汇报工作)

package 普通员工管理系统;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.JTextField; public class Work extends JFrame { /**
*
*/
private static final long serialVersionUID = 1L;
private JLabel l1 = new JLabel("汇报人编号:");
private JLabel l2 = new JLabel("汇报内容:");
private JTextField t1 = new JTextField();
private JTextArea tx2 = new JTextArea(50,50);
private JButton but1 = new JButton("提交"); public Work()
{
this.setSize(600, 400);
this.setTitle("汇报工作");
this.setLocation(200, 200); this.setLayout(null); l1.setBounds(80, 10, 100, 30);
t1.setBounds(180, 10, 150, 30); l2.setBounds(80, 80, 100, 30);
tx2.setBounds(180, 80, 250, 150); but1.setBounds(220, 280, 100, 30);
this.add(l1);
this.add(t1);
this.add(l2);
this.add(tx2);
this.add(but1); but1.addActionListener(new ActionListener() { @Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
new Home();
setVisible(false);
}
}); this.setVisible(true); } public static void main(String[] args) {
// TODO Auto-generated method stub
new Work(); } }

Password GUI界面(密码重置)

package 普通员工管理系统;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPasswordField; public class Password extends JFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
private JLabel pslable1 = new JLabel("旧密码:");
private JLabel pslable2 = new JLabel("新密码:");
private JLabel pslable3 = new JLabel("确定密码:"); private JPasswordField psf1 = new JPasswordField();
private JPasswordField psf2 = new JPasswordField();
private JPasswordField psf3 = new JPasswordField(); private JButton but1 = new JButton("修改"); public Password()
{
this.setSize(600, 400);
this.setLocation(200, 200);
this.setTitle("重置密码"); this.setLayout(null); pslable1.setBounds(100, 10, 100, 30);
pslable2.setBounds(100, 80, 100, 30);
pslable3.setBounds(100, 150, 100, 30);
psf1.setBounds(200, 10, 150, 30);
psf2.setBounds(200, 80, 150, 30);
psf3.setBounds(200, 150, 150, 30);
but1.setBounds(250, 230, 70,40);
this.add(pslable1);
this.add(pslable2);
this.add(pslable3);
this.add(psf1);
this.add(psf2);
this.add(psf3);
this.add(but1); but1.addActionListener(new ActionListener() { @Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
setVisible(false);
new Login(); }
});
this.setVisible(true);
} public static void main(String[] args) {
// TODO Auto-generated method stub
new Password(); } }

Achievement GUI界面(成绩查询)

package 普通员工管理系统;

import java.awt.BorderLayout;
import javax.swing.*;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTable; public class Achievement extends JFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
Object[] columnTitle = { "被评测人", "评测经理", "评测成绩" };
Object[][] tableDate = {
new Object[] { "0001", "0002", "89.0" },
new Object[] { "0003", "0002", "77.0" },
new Object[] { "0004", "0002", "23.0" }
};
private JTable tb1 = new JTable(tableDate, columnTitle);
private JLabel lab1 = new JLabel("测评成绩如下:");
private JScrollPane tp1 = new JScrollPane(); public Achievement()
{
this.setSize(600, 400);
this.setTitle("测评成绩");
this.setLocation(200, 200);
//this.setLayout(new FlowLayout(FlowLayout.LEFT, 10,10));
this.setLayout(new BorderLayout());
//this.add(new JScrollPane(tb1));
//this.setLayout(null);
this.add(lab1,BorderLayout.NORTH);
this.add(new JScrollPane(tb1),BorderLayout.CENTER);
this.setVisible(true);
} public static void main(String[] args) {
// TODO Auto-generated method stub
new Achievement(); } }

Questionnaire GUI界面(调查问卷)

package 普通员工管理系统;

import javax.swing.*;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton; public class Questionnaire extends JFrame { /**
*
*/
private static final long serialVersionUID = 1L; //按钮
private JButton bt = new JButton("提交"); //标签
private JLabel l0 = new JLabel("基本情况调查表");
private JLabel l1 = new JLabel("1.喜欢的体育运动:");
private JLabel l2 = new JLabel("2.性别");
private JLabel l3 = new JLabel("3.出生年份:");
private JLabel l4 = new JLabel("4.联系方式:");
private JLabel l5 = new JLabel("5.将您的其他爱好填写到下面区域中:"); //复选框
private JCheckBox cb1 = new JCheckBox("足球");
private JCheckBox cb2 = new JCheckBox("羽毛球");
private JCheckBox cb3 = new JCheckBox("篮球"); //单选框
private JRadioButton rb1 = new JRadioButton("男");
private JRadioButton rb2 = new JRadioButton("女"); //下拉列表
String st[] = {"1978","1979","1976"};
private JComboBox Cob = new JComboBox(st); //文本框
private JTextField tx = new JTextField(); //文本域
private JTextArea tx2 = new JTextArea(50,40); public Questionnaire()
{
this.setSize(400, 500);
this.setLocation(600, 200);
this.setTitle("调查问卷");
this.setLayout(null); //标题定位
l0.setBounds(150, 5, 100, 20); //问题1定位
l1.setBounds(0, 20, 150, 20);
cb1.setBounds(0, 40, 150, 20);
cb2.setBounds(0, 60, 150, 20);
cb3.setBounds(0, 80, 150, 20); //问题2定位
l2.setBounds(0, 100, 150, 20);
rb1.setBounds(0, 120, 150, 20);
rb2.setBounds(0, 140, 150, 20); //问题3定位
l3.setBounds(0, 160, 150, 20);
Cob.setBounds(80, 160, 80, 20); //问题4定位
l4.setBounds(0, 200, 150, 20);
tx.setBounds(90, 200, 100, 20); //问题5布局
l5.setBounds(0, 240, 300, 20);
tx2.setBounds(0, 260, 300,100 ); //按钮布局
bt.setBounds(160, 390,60, 30); this.add(l0); this.add(l1);
this.add(cb1);
this.add(cb2);
this.add(cb3); this.add(l2);
this.add(rb1);
this.add(rb2); this.add(l3);
this.add(Cob); this.add(l4);
this.add(tx); this.add(l5);
this.add(tx2); this.add(bt);
this.setVisible(true);
} public static void main(String[] args) {
// TODO Auto-generated method stub
new Questionnaire(); } }

Java普通员工管理系统的更多相关文章

  1. 基于SSM实现的简易员工管理系统(网站上线篇)

    经历无数苦难,好不容易,网站终于上线了.=.=内牛满面ing.chengmingwei.top就是本员工管理系统的主页啦.是的,很简陋,但是毕竟是第一次嘛,所以慢慢来嘛. 如上次所说的(网站简介,见: ...

  2. 基于SSM实现的简易员工管理系统

    之前自学完了JAVA基础,一直以来也没有做什么好玩的项目,最近暑假,时间上比较空闲,所以又学习了一下最近在企业实际应用中比较流行的SSM框架,以此为基础,通过网络课程,学习编写了一个基于SSM实现的M ...

  3. 基于SSH实现员工管理系统之框架整合篇

    本篇文章来源于:https://blog.csdn.net/zhang_ling_yun/article/details/77803178 以下内容来自慕课网的课程:基于SSH实现员工管理系统之框架整 ...

  4. 员工管理系统(集合与IO流的结合使用 beta1.0 ArrayList<Employee>)

    package cn.employee; public class Employee { private int empNo; private String name; private String ...

  5. 员工管理系统(集合与IO流的结合使用 beta2.0 ObjectInputStream/ ObjectOutputStream)

    package cn.employee; import java.io.Serializable; public class Employee implements Serializable{ pri ...

  6. 员工管理系统(集合与IO流的结合使用 beta5.0 BufferedReader/ BufferedWriter)

    package cn.gee; public class Emp { private String id;//员工编号 一般是唯一的 private String sname; private int ...

  7. 员工管理系统(集合与IO流的结合使用 beta4.0 ObjectInputStream/ ObjectOutputStream)

    package cn.employee_io; import java.io.Serializable; public class Employee implements Serializable{ ...

  8. 员工管理系统(集合与IO流的结合使用 beta3.0 BufferedReader / ObjectOutputStream)

    Employee.java package cn.employee_io; public class Employee { private String empId; private String n ...

  9. 简单的员工管理系统(Mysql+jdbc+Servlet+JSP)

    员工管理系统 因为学业要求,需要完成一个过关检测,但是因为检测之前没有做好准备,且想到之前用mysql+jdbc+Struts2+bootstrap做成了一个ATM系统(主要有对数据的增删改查操作), ...

随机推荐

  1. 开发工具IDEA环境安装配置

    开发工具IDEA环境安装配置 该工具和eclipse类似,但是使用感受确实比eclipse好,越来越多人开始使用IDEA了. 下载地址如下 : https://www.jetbrains.com/id ...

  2. 【数学 exgcd】bzoj1407: [Noi2002]Savage

    exgcd解不定方程时候$abs()$不能乱加 Description Input 第1行为一个整数N(1<=N<=15),即野人的数目. 第2行到第N+1每行为三个整数Ci, Pi, L ...

  3. ELK踩过的各种坑 6.4版本

    一.elasticsearch 1.服务正常启动,但不能正常访问 [root@linux-node1 elasticsearch]# systemctl start elasticsearch [ro ...

  4. WIN10配置MAVEN

    添加新的系统环境变量M2_HOME, 并设置其值为你安装的目录MAVEN_HOME=D:\Softwares\apache-maven-3.2.2. 更新系统PATH 变量, 添加;%M2_HOME% ...

  5. BZOJ 1831: [AHOI2008]逆序对

    题目大意: 给出一个序列,有几个位置上的数字任意.求最小的逆序对数. 题解: 自己决定放置的数一定是单调不降的.不然把任意两个交换一下就能证明一定会增加逆序对. 然后就可以DP了,f[i][j]表示第 ...

  6. 一、harbor部署之centos7的基本配置

    1 最小安装centos7 ...安装省略... centos7最小化安装后没ifconfig命令,用 ip addr 命令查看网络信息. 2 配置网络 1.cd /etc/sysconfig/net ...

  7. 4C. Stars

    4C. Stars Time Limit: 2000ms Case Time Limit: 2000ms Memory Limit: 65536KB   64-bit integer IO forma ...

  8. SPOJ-New Distinct Substrings,注意会爆int

    SUBST1 - New Distinct Substrings 和上一题题意一样,只是数据范围有所改动,50000. 思路还是和上一题一样,所有字串数(len+1)*len/2.注意这里可能爆int ...

  9. 九度oj 题目1031:xxx定律 题目1033:继续xxx定律

    题目描述:     对于一个数n,如果是偶数,就把n砍掉一半:如果是奇数,把n变成 3*n+ 1后砍掉一半,直到该数变为1为止.    请计算需要经过几步才能将n变到1,具体可见样例. 输入:     ...

  10. Python之FTP传输

    访问FTP,无非两件事情:upload和download,最近在项目中需要从ftp下载大量文件,然后我就试着去实验自己的ftp操作类,如下(PS:此段有问题,别复制使用,可以参考去试验自己的ftp类! ...