学生信息管理系统(JAVA+MYSQL)

使用Java Swing和MySQL创建的学生信息管理系统,具备录入、查询、修改、删除和显示所有学生信息的功能。适用于课程设计,包含完整代码源文件、数据库驱动和教程链接。
摘要由CSDN通过智能技术生成

基于Java swing+MySQL实现学生信息管理系统:功能:1录入学生基本信息的功能; 2查询学生基本信息的功能; 3修改学生基本信息的功能 ;4删除学生基本信息的功能 ;5显示所有学生信息的功能;应付一般课设足矣,分享给大家。

如有需要:https://pan.baidu.com/s/1JqLFKPlmhV2INeETy9lHAQ

提取码:nima

里面包括了所有代码源文件+mysql8.0.25驱动jar包+登录页面时的背景图345.jpg

1.开发环境:jdk11+win10+mysql 8+IDEA

记得将数据库与IDEA或者eclipse连接起来,并记得添加数据库驱动jar包

这两个分别是添加jar包和idea连接mysql大家可以做一下参考

IDEA导入mysql数据库驱动_跟着太阳.的博客-CSDN博客[这里是图片004]https://blog.csdn.net/qq_54705917/article/details/123484397?spm=1001.2014.3001.5502IDEA连接mysql数据库_跟着太阳.的博客-CSDN博客[这里是图片005]https://blog.csdn.net/qq_54705917/article/details/123484737?spm=1001.2014.3001.5502

2.数据库设计

代码:

库:create databasestudent
表:create table stu(
stuId varchar(20),
stuName varchar(20),
stuSex varchar(20),
stuAge varchar(20),
stuJG varchar(20),
stuLX varchar(20),
stuBJ varchar(20)
);

3. 窗口及功能设计

(1).主函数

main.java

import javax.swing.*;

public class main {
    public static void main(String[] args) {
        JFrame jf = new StuLogin();
    }
}

(2).登录界面(默认的账号密码都为:admin)

StuLogin.java

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;

public class StuLogin extends JFrame {
    private StuLogin self;
    private ImageIcon imageIcon;
    private Image image;
    private String userid;// 登陆用户名和密码
    private String password;
    private JLabel unLabel = new JLabel("账号:");// 登陆面板控件
    private JTextField unField = new JTextField();
    private JLabel pwLabel = new JLabel("密码:");
    private JPasswordField pwField = new JPasswordField();
    private JButton dl = new JButton("登录");
    private JButton d2 = new JButton("重置");
    public StuLogin() {

        this.self = this;
        this.setSize(350, 300);// 设置登陆面板
        设置窗口背景图
        //先将contentPane设置成透明的
        ((JPanel)getContentPane()).setOpaque(false);
        //再设置图片
        imageIcon = new ImageIcon("345.jpg");//图标组件
        image = imageIcon.getImage();
        JLabel imgLabel = new JLabel(imageIcon);
        getLayeredPane().add(imgLabel, new Integer(Integer.MIN_VALUE));
        imgLabel.setBounds(0,0,400,300); //背景图片的位置

        this.setIconImage(image);//设置窗口图像
        this.setLocation(600,300);
        this.setVisible(true);
        this.setResizable(false);
        this.setLayout(null);
//      this.getContentPane().setBackground(Color.BLACK);设置窗口背景色;

        //设置窗口名称
        this.setTitle("学生信息管理系统");
        unLabel.setSize(50, 30);
        unLabel.setLocation(60, 40);
        unLabel.setForeground(Color.red);
        unLabel.setFont(new Font("楷体",Font.BOLD,15));
        unField.setSize(150, 35);
        unField.setLocation(110, 35);
        pwLabel.setSize(50, 30);
        pwLabel.setLocation(60, 100);
        pwLabel.setForeground(Color.red);
        pwLabel.setFont(new Font("楷体",Font.BOLD,15));
        pwField.setSize(150, 35);
        pwField.setLocation(110, 100);
        dl.setSize(80, 35);
        dl.setLocation(65, 175);
        dl.setBackground(Color.red);
        d2.setSize(80, 35);
        d2.setLocation(185, 175);
        d2.setBackground(Color.red);
        dl.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                userid = unField.getText();
                password = pwField.getText();
                if(userid.equals("admin")&&password.equals("admin")) {
                    self.setVisible(false);
//                    JOptionPane.showMessageDialog(null, "登录成功", "登录情况",JOptionPane.PLAIN_MESSAGE);
                    new StuManager();
                } else {
                    JOptionPane.showMessageDialog(null, "账号或密码错误!", "登录情况",JOptionPane.PLAIN_MESSAGE);
                }
            }
        });
        d2.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                unField.setText("");
             
  • 1
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值