登录
首页 » Java » java实验室预约管理系统(源码+数据库脚本)

java实验室预约管理系统(源码+数据库脚本)

于 2020-12-12 发布
0 244
下载积分: 1 下载次数: 1

代码说明:

随着高校教学资源逐步开发,高校教育资源的应用种类逐步增多。而实验室作为高校基本教育资源之一,与日常教学工作开展、课堂项目实践有着密切联系。由此,如何借助新时期技术,加强高校实验室应用数据信息程序开发,在高校智能化管理程序推广中占有基础性地位。该软件是以Java语言为实现预言。其功能在系统内部有源代码直接完成,操作人员只需输入一些简单的汉字,数字,即可达到自己的目标。 登陆账号:admin 密码:123456 package com.company; import com.company.Bean.Student;import com.company.Bean.Teacher;import com.company.Bean.User;import com.company.DB.DB; import javax.swing.*;import java.awt.event.ActionEvent;import java.awt.event.ActionListener; public class Main extends JFrame {    private JPanel p;    private JLabel lblName,lblPwd,lblRole;    private JTextField txtName;    private JPasswordField txtPwd;    private JButton btnOk,btnCancle;    String[] s = {"学生","教师","管理员"};    private JComboBox comboBox;    public Main(){        super("用户登录界面");        p = new JPanel();        p.setLayout(null);        lblRole=new JLabel("角色:");        comboBox=new JComboBox(s);        lblName = new JLabel("账户:");        lblPwd = new JLabel("密码:");        txtName = new JTextField(20);        txtPwd = new JPasswordField(20);        btnOk = new JButton("登录");        btnCancle = new JButton("取消");        //注册确定按钮的事件处理        btnOk.addActionListener(new ActionListener() {            @Override            public void actionPerformed(ActionEvent e) {                String strName = txtName.getText();                String strPwd = new String(txtPwd.getPassword());                System.out.println("用户名:" strName "密码:" strPwd);             }        });        //注册取消按钮的事件处理        btnCancle.addActionListener(new ActionListener() {             @Override            public void actionPerformed(ActionEvent e) {                //清空                txtName.setText("");                txtPwd.setText("");             }        });        lblRole.setBounds(90,50,60,25);        comboBox.setBounds(130,50,140,25);        lblName.setBounds(90,80,60,25);        txtName.setBounds(130,80,140,25);        lblPwd.setBounds(90,110,60,25);        txtPwd.setBounds(130,110,140,25);        btnOk.setBounds(130,150,60,25);        btnCancle.setBounds(200,150,60,25);        p.add(lblRole);        p.add(comboBox);        p.add(lblName);        p.add(txtName);        p.add(lblPwd);        p.add(txtPwd);        p.add(btnOk);        p.add(btnCancle);        this.add(p);        this.setSize(400,300);        this.setLocation(300,300);        //设置窗体不可改变大小        this.setResizable(false);        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);        btnOk.addActionListener(new ActionListener() {            @Override            public void actionPerformed(ActionEvent e) {               String account =txtName.getText().trim();               String password=txtPwd.getText().trim();               String role=null;               if(comboBox.getSelectedItem().equals("管理员")){                   role="admin";               }               else if(comboBox.getSelectedItem().equals("学生")) {                   role="student";               }               else{                   role="teacher";               }                if(role.equals("admin")){                    User user=new User(account,password);                    if (DB.Login(user)) {                        JOptionPane.showMessageDialog(null, "登录成功", "", JOptionPane.PLAIN_MESSAGE);                        AdminMain adminMain = new AdminMain();                        adminMain.setVisible(true);                        Main.this.setVisible(false);                    }                      else {                        JOptionPane.showMessageDialog(null,"账号密码错误", "", JOptionPane.PLAIN_MESSAGE);                    }                }                else if (role.equals("student")){                    Student student=new Student(account,password);                    if(DB.studentLogin(student)){                        StudentMain studentMain=new  StudentMain();                        studentMain.setVisible(true);                        Main.this.setVisible(false);                        JOptionPane.showMessageDialog(null, "登录成功", "", JOptionPane.PLAIN_MESSAGE);                    }                    else {                        JOptionPane.showMessageDialog(null,"账号密码错误", "", JOptionPane.PLAIN_MESSAGE);                    }                }                else if (role.equals("teacher")){                   Teacher teacher=new Teacher(account,password);                    if(DB.teacherLogin(teacher)){                        TeacherMain teacherMain=new TeacherMain();                        teacherMain.setVisible(true);                        Main.this.setVisible(false);                        JOptionPane.showMessageDialog(null, "登录成功", "", JOptionPane.PLAIN_MESSAGE);                    }                    else {                        JOptionPane.showMessageDialog(null,"账号密码错误", "", JOptionPane.PLAIN_MESSAGE);                    }                }            }        });        btnCancle.addActionListener(new ActionListener() {            @Override            public void actionPerformed(ActionEvent e) {                            }        });    }    public static void main(String[] args) { // write your code here        Main main=new Main();        main.setVisible(true);     }}

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • Java 设置Applet的显示位置(提高篇-实例550).zip
    Java 设置Applet的显示位置(提高篇-实例550).zip
    2019-10-03下载
    积分:1
  • Java串口调试助手工程源码
    使用Java语言开发的一个串口调试助手,测试基本没有问题。虽然经过多次修改,但功能还没有完善,可能还存在一些小问题。现在共享给大家,以供想要学习Java串口应用开发的朋友参考。若发现代码有错误之处,还望能够提出改正,大家共同学习,共同进步。有兴趣的朋友也可以在此基础上完善软件的功能。
    2016-04-28下载
    积分:1
  • java算法斐波那契(Fibonacci)数列
    java算法斐波那契(Fibonacci)数列【核心代码】public class Fibonacci { /** * fibonacci数列 */ // 第一种方法 public static void main(String[] args) { Scanner s = new Scanner(System.in); System.out.print("请输入n(n>0)的值: "); int n = s.nextInt(); int f1 = 1, f2 = 1; for (int i = 1; i
    2021-03-18 16:09:19下载
    积分:1
  • Springmvc+Mybatis客户关系管理系统CRM(源码+数据库+文档)
    Springmvc+Mybatis客户关系管理系统CRM(源码+数据库+文档)
    2020-12-12下载
    积分:1
  • java仓库管理系统源码
    含数据库脚本开发平台:eclipse数据库平台:mysqlyog登陆用户名:feeling(管理员)密码:123
    2021-05-06下载
    积分:1
  • Java酒店客房管理系统源码+数据库脚本(基于java swing)
    包含数据库文件,可以直接导入运行,还包含一系列文档包括论文等,性价比超高。
    2019-10-18下载
    积分:1
  • 商品添加的实现(idea maven+ssh)
    idea maven ssh ,含数据库脚本
    2020-04-16下载
    积分:1
  • Java Coding Problems - Improve your Java Programming skills by solving real-world coding challenges.epub
    The super-fast evolution of the JDK between versions 8 and 12 has increased the learning curve of modern Java, therefore has increased the time needed for placing developers in the Plateau of Productivity. Its new features and concepts can be adopted to solve a variety of modern-day problems. This book enables you to adopt an objective approach to common problems by explaining the correct practices and decisions with respect to complexity, performance, readability, and more.Java Coding Problems will help you complete your daily tasks and meet deadlines. You can count on the 300 applications containing 1,000 examples in this book to cover the common and fundamental areas of interest: strings, numbers, arrays, collections, data structures, date and time, immutability, type inference, Optional, Java I/O, Java Reflection, functional programming, concurrency and the HTTP 
    2020-03-03下载
    积分:1
  • 消息推送系统源码
    基于JAVA实现的消息推送系统,CIM(CROSS-IM) 一款面向开发者的 IM(即时通讯)系统;同时提供了一些组件帮助开发者构建一款属于自己可水平扩展的 IM
    2020-12-04下载
    积分:1
  • The Java Virtual Machine Specification, Java SE 8 Edition-jvms8.pdf
    The Java Virtual Machine Specification, Java SE 8 Edition-jvms8.pdf
    2020-03-26下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载