Database big job-student dormitory management system

Introduction

This program is a major database assignment in my sophomore period. I wrote a program after learning the database. It is a student dormitory management system, which can realize the management of student dormitories.

This program is written in Java and developed using eclipse. The database uses MySQL database with Navicat for data management. The program uses JDBC technology for database connection, and Java Swing is used to develop a graphical interface. The entire system has a beautiful interface and rich functions. Click the "Change Appearance" button on the homepage of this system to switch the appearance of different styles. The system is divided into three modes, student mode, dormitory management mode and system management mode, which are respectively oriented to students, dormitory management and system administrators. The different modes are as follows: For different functions, please refer to the introduction below for details.

This system has complete and rich functions (you can export all kinds of information in the system as excel files), the program has strong error detection ability, and the interface is simple and beautiful (every component has been carefully adjusted), but it was lazy at the time, so some codes were not available. After optimization, it may be a bit complicated, and for the sake of beautiful interface, most of the code is adjusting the interface components, please don't mind, readers can take the essence and discard the dross.

The program source code and program design manual can be downloaded by clicking the link below for your reference.

Download Link: Student Dormitory Management System



data design

There are 8 tables in the database of this system. The database table design and ER diagram are shown below. For detailed data design, please download the data design table or program design manual at the beginning of the article to view it.
General Data Sheet
Total ER Diagram

Procedure flow chart

The general flow of the program is as follows:
Program flow chart

function display

This program has a lot of functions and details, and only some of the functions are shown here. If you want to know the complete functions and details, please download the program at the beginning of the article and experience it.

Welcome interface - change the appearance

Open this program, you will first come to the welcome interface, where you can choose student login and administrator login, click "Change Appearance" in the upper right corner to change the overall appearance of the system, there are 5 different styles of appearance.

Change appearance

Log in

Click "Student Login" on the welcome interface, and then enter the student account and password. If the login is successful, the system will enter the student mode; click "Administrator Login", and then enter the dormitory management account password. Enter "admin", the system will enter the system management mode.

student login
Admin login

student mode

The student mode is aimed at students. After entering their account number (student number) and password, students can enter the menu interface of the student mode, where they can select corresponding functions. The functions of the student mode are less, and the functions are as follows.

student mode

personal information

"Personal Information" function, you can view your personal details.

personal information

Dormitory repair

The function of "report for dormitory repair" allows you to report for dormitory repair on this interface, and the submitted information will be saved in the database and displayed on the corresponding interface of the dormitory management mode and system management mode.

Dormitory repair

Suggestions and Feedback

The "suggestion and feedback" function allows you to make suggestions and feedback on this interface, and the submitted information will be saved in the database and displayed on the corresponding interfaces of the hosting mode and system management mode.

Suggestions and Feedback

change Password

"Change password" function, you can modify your own password on this interface, you need to enter the old password and the new password twice, and there will be a corresponding prompt if you enter an error.

change Password

system management mode

The system management mode is aimed at system administrators. After the administrator enters the specified account number and password (both admin), he can enter the menu interface of the system management mode, where he can choose the corresponding functions. The system management mode has the most functions. It can manage students, dormitory management, and dormitories in an all-round way. The specific functions are as follows.

system management mode

management function

In the system management mode, the dormitory, dormitory, dormitory management, students, and accommodation information can be fully managed, including adding, deleting, modifying, checking, etc. The following uses "student management" as an example to demonstrate the management functions.

Click "Student Management" to enter the student management interface, where you can see the simple information of all students.
student management

Click the "View" button of a student row to view the detailed information of the student, where the student information can be modified and deleted.
Student Management - View

For example, click the "Modify Student Information" button to modify the student information. After the modification is completed, click "Save", and the information will be updated synchronously in the database.
Student Management - Modify

Click the "Add" button on the top of the "Student Management" interface to add students to the system. After entering complete student information and confirming the addition, the information will be saved to the database and the student is successfully added.
Student Management - Add

Click the "Export" button on the top of the "Student Management" interface to export student information into an excel file.
Student Management - Export
Student Management - Export Success

Click the "Query" button on the top of the "Student Management" interface, you will come to the student information query interface, enter the specified conditions and click "Query", the system will query the eligible students, as follows to query all 2019 students.
Student Management - Inquiry
Student Management - Query Success

The above shows the "Student Management" function, and other management functions are similar.

bedroom assignment

The "dorm allocation" function can automatically allocate dormitories to students instead of manual allocation to save manpower. If you want to allocate dormitories accurately and according to your wishes, you need to manually allocate dormitories on the "accommodation management" interface.

bedroom assignment

check-in

The "Entry and Exit Registration" function can register the records of students entering and leaving the dormitory building, and can add, delete, export, and query the entry and exit records. Click the "Registration" button above to add entry and exit records, and enter the corresponding information. Name, click "Get Current Time" on the right side of the interface, the current time can be automatically obtained and entered automatically.

check-in
check-in-check-in

Dormitory repair

"Dormitory repair" function, in this interface, you can view the dormitory repair information submitted by all students. Click the "View" button to view detailed repair information. In the repair report detailed interface, you can process and delete the report, and the dormitory repair information can also be exported. and query.

Dormitory repair
Dormitory Repair - View

Suggestions and Feedback

"Suggestion and Feedback" function, in this interface, you can view the suggestions and feedback submitted by all students. Click the "View" button to enter the detailed interface to view the detailed content, and you can also delete it here. Suggestions and feedback can also be exported.

Suggestions and Feedback
Suggestions and Feedback - View

Delete library and run away

"Delete database and run away" function, this function needs to enter the password "ESCAPE", and then click the "Confirm to delete database and run away" button to delete the database of this system and run away. After this function is successfully executed, it will automatically exit the program . The system will no longer be usable.

Delete library and run away

host mode

The host management mode is aimed at the host management group. After the host management enters its own account number (ie number) and password, it can enter the menu interface of the host management mode, where you can select the corresponding functions. The functions of the host management mode and the system management mode Similar, but the difference is that in the dormitory management mode, the dormitory management can only operate the dormitory buildings it manages. Since the functions of the two are similar, the functions of the dormitory management mode will not be shown here. Readers can download the program to experience it by themselves.

host mode

code display

There are a lot of codes in this program and detailed notes. Only some important codes are shown here. For the complete codes, please download the program at the beginning of the article to learn more.

For the sake of the aesthetics of the system interface , many codes of this program are adjusting the interface components, please don't mind.

Info class

Information class, which defines the classes of various objects, such as: dormitory, students, dormitory management, etc.

import java.util.*;
import java.text.*;

//各种信息类
public class Info {
    
    
	
}

class Floor {
    
     //宿舍楼
	String floor_num; //楼号
	int layer_amount; //层数
	int room_amount; //房间数
	String category; //类别
	String sex; //居住时间
	String admin_num; //宿管编号
	public Floor(String floor_num, String layer_amount, String room_amount, String category, String sex, String admin_num) {
    
    
		this.floor_num=floor_num;
		this.layer_amount=Integer.parseInt(layer_amount);
		this.room_amount=Integer.parseInt(room_amount);
		this.category=category;
		this.sex=sex;
		this.admin_num=admin_num;
	}
}

class Dormitory {
    
     //宿舍
	String floor_num; //楼号
	int layer; //楼层
	int room_num; //宿舍号
	int bed_total; //总床位数
	int bed_surplus; //剩余床位数
	int price; //单价
	public Dormitory(String floor_num, String layer, String room_num, String bed_total, String bed_surplus, String price) {
    
    
		this.floor_num=floor_num;
		this.layer=Integer.parseInt(layer);
		this.room_num=Integer.parseInt(room_num);
		this.bed_total=Integer.parseInt(bed_total);
		this.bed_surplus=Integer.parseInt(bed_surplus);
		this.price=Integer.parseInt(price);
	}
}

class Admin {
    
     //宿管
	String admin_num; //编号
	String password; //密码
	String name; //姓名
	String sex; //性别
	String phone; //手机
	public Admin(String admin_num, String password, String name, String sex, String phone) {
    
    
		this.admin_num=admin_num;
		this.password=password;
		this.name=name;
		this.sex=sex;
		this.phone=phone;
	}
}

class Student {
    
     //学生
	String stu_num; //学号
	String password; //密码
	String name; //姓名
	String sex; //性别
	int birth; //出生日期
	int grade; //年级
	String faculty; //院系
	String clas; //班级
	String phone; //手机号
	String yes_no; //是否入住
	public Student(String stu_num, String password, String name, String sex, String birth, String grade, String faculty, String clas, String phone, String yes_no) {
    
    
		this.stu_num=stu_num;
		this.password=password;
		this.name=name;
		this.sex=sex;
		this.birth=Integer.parseInt(birth);
		this.grade=Integer.parseInt(grade);
		this.faculty=faculty;
		this.clas=clas;
		this.phone=phone;
		this.yes_no=yes_no;
	}
}

class Stay {
    
     //住宿
	String stu_num; //学号
	String name; //姓名
	String floor_num; //楼号
	int layer; //楼层
	int room_num; //宿舍号
	Date time; //入住时间
	public Stay(String stu_num, String name, String floor_num, String layer, String room_num, String time) {
    
    
		SimpleDateFormat timeFormat=new SimpleDateFormat("yyyy-MM-dd");
		this.stu_num=stu_num;
		this.name=name;
		this.floor_num=floor_num;
		this.layer=Integer.parseInt(layer);
		this.room_num=Integer.parseInt(room_num);
		try {
    
    
			this.time=timeFormat.parse(time);
		} catch (ParseException e) {
    
    
			e.printStackTrace();
		}
	}
}

class InOut {
    
     //出入
	String stu_num; //学号
	String name; //姓名
	String floor_num; //楼号
	String category; //类别
	Date time; //时间
	public InOut(String stu_num, String name, String floor_num, String category, String time) {
    
    
		SimpleDateFormat timeFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		this.stu_num=stu_num;
		this.name=name;
		this.floor_num=floor_num;
		this.category=category;
		try {
    
    
			this.time=timeFormat.parse(time);
		} catch (ParseException e) {
    
    
			e.printStackTrace();
		}
	}
}

class Repair {
    
     //报修
	String stu_num; //学号
	String name; //姓名
	String floor_num; //楼号
	int layer; //楼层
	int room_num; //宿舍号
	String info; //报修详细
	String yes_no; //是否处理
	public Repair(String stu_num, String name, String floor_num, String layer, String room_num, String info, String yes_no) {
    
    
		this.stu_num=stu_num;
		this.name=name;
		this.floor_num=floor_num;
		this.layer=Integer.parseInt(layer);
		this.room_num=Integer.parseInt(room_num);
		this.info=info;
		this.yes_no=yes_no;
	}
}

class Advice {
    
     //建议与反馈
	String stu_num; //学号
	String name; //姓名
	String info; //详细信息
	public Advice(String stu_num, String name, String info) {
    
    
		this.stu_num=stu_num;
		this.name=name;
		this.info=info;
	}
}

class Stu {
    
     //学生,用于分配宿舍的信息
	String stu_num; //学号
	int grade; //年级
	String faculty; //院系
	String clas; //班级
	public Stu(String stu_num, String grade, String faculty, String clas) {
    
    
		this.stu_num=stu_num;
		this.grade=Integer.parseInt(grade);
		this.faculty=faculty;
		this.clas=clas;
	}
}

class Dor {
    
     //宿舍,用于分配宿舍的信息
	String floor_num; //楼号
	int layer; //楼层
	int room_num; //宿舍号
	int bed_surplus; //剩余床位数
	public Dor(String floor_num, String layer, String room_num, String bed_surplus) {
    
    
		this.floor_num=floor_num;
		this.layer=Integer.parseInt(layer);
		this.room_num=Integer.parseInt(room_num);
		this.bed_surplus=Integer.parseInt(bed_surplus);
	}
}

HomePage class

The home page class, the main method is included in this class, which is the entry point of the program, and defines the system's welcome interface, login interface, appearance change function, and JDBC operation.

import java.sql.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class HomePage {
    
     //主页类
	static JFrame mainJFrame=new JFrame("学生宿舍管理系统");
	static Container con=mainJFrame.getContentPane();
	static boolean flag; //是否为管理员
	static int appearance=0; //当前外观
	static JLabel lb_appearance=new JLabel("<html>当前外观:<br>默认</html>"); //当前外观
	static Connection connection=null;
	
	public static void main(String[] args) {
    
    
		mainJFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		mainJFrame.setResizable(false);
		con.setLayout(null);
		welcomePage();
	}
	
	public static void welcomePage() {
    
     //欢迎界面
		mainJFrame.setSize(550,400);
		mainJFrame.setLocationRelativeTo(null);
		JPanel pn=new JPanel();
		pn.setSize(550,400);
		pn.setLayout(null);
		JLabel lb1=new JLabel("欢迎使用"),lb2=new JLabel("学生宿舍管理系统");
		JButton bt1=new JButton("学生登录"),bt2=new JButton("管理员登录"),bt_changeAppearance=new JButton("更换外观",new ImageIcon("image/更换外观.png"));
		lb1.setFont(new Font("黑体",0,35));
		lb1.setBounds(200,30,150,100);
		lb2.setFont(new Font("黑体",0,35));
		lb2.setBounds(128,100,300,80);
		bt1.setFont(new Font("黑体",0,22));
		bt1.setBounds(70,210,170,70);
		bt1.setCursor(new Cursor(Cursor.HAND_CURSOR));
		lb_appearance.setFont(new Font("黑体",0,17));
		lb_appearance.setBounds(5,5,150,40);
		bt2.setFont(new Font("黑体",0,22));
		bt2.setBounds(310,210,170,70);
		bt2.setCursor(new Cursor(Cursor.HAND_CURSOR));
		bt_changeAppearance.setFont(new Font("黑体",0,17));
		bt_changeAppearance.setBounds(420,10,130,25);
		bt_changeAppearance.setContentAreaFilled(false);
		bt_changeAppearance.setBorderPainted(false);
		bt_changeAppearance.setCursor(new Cursor(Cursor.HAND_CURSOR));
		pn.add(lb1);
		pn.add(lb2);
		pn.add(lb_appearance);
		pn.add(bt1);
		pn.add(bt2);
		pn.add(bt_changeAppearance);
		con.add(pn);
		mainJFrame.setVisible(true);
		bt1.addActionListener(new ActionListener() {
    
     //进入学生登录界面
			public void actionPerformed(ActionEvent e) {
    
    
				flag=false;
				con.remove(pn);
				mainJFrame.repaint();
				loginPage();
				mainJFrame.validate();
			}
		});
		bt2.addActionListener(new ActionListener() {
    
     //进入管理员登录界面
			public void actionPerformed(ActionEvent e) {
    
    
				flag=true;
				con.remove(pn);
				mainJFrame.repaint();
				loginPage();
				mainJFrame.validate();
			}
		});
		bt_changeAppearance.addMouseListener(new MouseListener() {
    
     //更换整体界面外观
			public void mouseEntered(MouseEvent arg0) {
    
    
				bt_changeAppearance.setForeground(Color.blue);
			}
			public void mouseExited(MouseEvent arg0) {
    
    
				bt_changeAppearance.setForeground(null);
			}
			public void mouseClicked(MouseEvent arg0) {
    
    
				try {
    
    
					appearance++;
					String lookAndFeel=null;
					switch(appearance) {
    
    
					case 1: //Windows风格
						lookAndFeel="com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
						lb_appearance.setText("<html>当前外观:<br>Windows</html>");
						break;
					case 2: //Nimbus风格
						lookAndFeel="com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel";
						lb_appearance.setText("<html>当前外观:<br>Nimbus</html>");
						break;
					case 3: //Windows Classic风格
						lookAndFeel="com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel";
						lb_appearance.setText("<html>当前外观:<br>Windows Classic</html>");
						break;
					case 4://Motif风格
						lookAndFeel="com.sun.java.swing.plaf.motif.MotifLookAndFeel";
						lb_appearance.setText("<html>当前外观:<br>Motif</html>");
						break; 
					case 5: //默认风格
						lookAndFeel="javax.swing.plaf.metal.MetalLookAndFeel";
						lb_appearance.setText("<html>当前外观:<br>默认</html>");
						break;
					}
					UIManager.setLookAndFeel(lookAndFeel);
					SwingUtilities.updateComponentTreeUI(mainJFrame);
					if(appearance==5)
						appearance=0;
		        } catch(Exception ex) {
    
    
		        	System.out.println(ex);
		        }
			}
			public void mousePressed(MouseEvent arg0){
    
    }
			public void mouseReleased(MouseEvent arg0){
    
    }
		});
	}
	
	public static void loginPage() {
    
     //登录界面
		mainJFrame.setSize(550,400);
		mainJFrame.setLocationRelativeTo(null);
		JPanel pn=new JPanel();
		pn.setSize(550,400);
		pn.setLayout(null);
		JButton bt1=new JButton("返回",new ImageIcon("image/返回.png")),bt2=new JButton("登  录");
		JTextField tf=new JTextField();
		JPasswordField pf=new JPasswordField();
		JLabel lb1,lb2=new JLabel("账号:"),lb3=new JLabel("密码:");
		if(flag) {
    
    
			lb1=new JLabel("管理员登录");
			lb1.setFont(new Font("黑体",0,35));
			lb1.setBounds(185,30,180,100);
		}
		else {
    
    
			lb1=new JLabel("学生登录");
			lb1.setFont(new Font("黑体",0,35));
			lb1.setBounds(200,30,150,100);
		}
		lb2.setFont(new Font("黑体",0,25));
		lb2.setBounds(100,100,80,100);
		lb3.setFont(new Font("黑体",0,25));
		lb3.setBounds(100,150,80,100);
		tf.setFont(new Font("黑体",0,25));
		tf.setBounds(170,130,230,40);
		pf.setFont(new Font(null,0,25));
		pf.setBounds(170,180,230,40);
		bt2.setFont(new Font("黑体",0,25));
		bt2.setBounds(200,250,150,60);
		bt2.setCursor(new Cursor(Cursor.HAND_CURSOR));
		bt1.setFont(new Font("黑体",0,17));
		bt1.setBounds(1,10,92,25);
		bt1.setContentAreaFilled(false);
		bt1.setBorderPainted(false);
		bt1.setCursor(new Cursor(Cursor.HAND_CURSOR));
		pn.add(lb1);
		pn.add(lb2);
		pn.add(lb3);
		pn.add(tf);
		pn.add(pf);
		pn.add(bt1);
		pn.add(bt2);
		con.add(pn);
		bt1.addMouseListener(new MouseListener() {
    
     //返回到欢迎界面
			public void mouseEntered(MouseEvent arg0) {
    
    
				bt1.setForeground(Color.blue);
			}
			public void mouseExited(MouseEvent arg0) {
    
    
				bt1.setForeground(null);
			}
			public void mouseClicked(MouseEvent arg0) {
    
    
				con.remove(pn);
				mainJFrame.repaint();
				welcomePage();
				mainJFrame.validate();
			}
			public void mousePressed(MouseEvent arg0){
    
    }
			public void mouseReleased(MouseEvent arg0){
    
    }
		});
		bt2.addActionListener(new ActionListener() {
    
     //登录,连接数据库获取账号密码并检验,正确则进入功能界面
			public void actionPerformed(ActionEvent e) {
    
    
				databaseConnection(); //连接MySQL数据库
				if(flag) //进行管理员账号密码检验
					new Login().adminLogin(tf.getText(),String.valueOf(pf.getPassword()));
				else //进行学生账号密码检验
					new Login().studentLogin(tf.getText(),String.valueOf(pf.getPassword()));;
			}
		});
	}
	
	public static void databaseConnection() {
    
     //连接MySQL数据库
		final String JDBC_DRIVER="com.mysql.cj.jdbc.Driver"; //JDBC驱动名
	    final String DB_URL="jdbc:mysql://localhost:3306/dormitory_system?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC"; //数据库URL
	    final String USER="root"; //数据库用户名
	    final String PASS="root"; //数据库密码
	    try {
    
    
	    	Class.forName(JDBC_DRIVER); //加载JDBC驱动
	    	connection=DriverManager.getConnection(DB_URL,USER,PASS); //连接数据库
	    }catch(SQLException e){
    
    
            e.printStackTrace();
        }catch(Exception e){
    
    
            e.printStackTrace();
        }
	}
}

Login class

The login class is used for login verification, including the login of students, dormitory administrators, and system administrators.

import java.sql.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Login {
    
     //登录类
	JLabel lb_tips=new JLabel(); //提示窗口的内容
	
	public void adminLogin(String account,String password) {
    
     //管理员登录(包括系统管理员和宿管)
		boolean flag=false; //是否查找到相应账号密码
		if(account.equals("admin") && password.equals("admin")) {
    
     //检验是否为系统管理员账号密码,若是,则进入系统管理员功能界面
			lb_tips.setText("登录成功!");
			loginTips();
			new SysAdminFunction();
			HomePage.mainJFrame.dispose();
		}
		else {
    
     //若不是,则进行宿管账号密码检测
			String admin_num=null, pass; //宿管账号密码
			try {
    
    
				String sql="SELECT admin_num, password FROM admin"; //SQL语句
				PreparedStatement ps; //创建PreparedStatement类对象ps,用来执行SQL语句
				ps=HomePage.connection.prepareStatement(sql); //把操作数据库返回的结果保存到ps中
	            ResultSet rs=ps.executeQuery(sql); //ResultSet类,用来存放获取的结果集
	            while(rs.next()){
    
     //遍历结果集
	            	admin_num=rs.getString("admin_num");
	                pass=rs.getString("password");
	                if(account.equals(admin_num) && password.equals(pass)) {
    
    
	                	flag=true;
	                	break;
	                }
	            }
	            rs.close();
	            ps.close();
			}catch(SQLException e){
    
    
	            e.printStackTrace();
	        }
			if(flag) {
    
     //若宿管账号密码正确,则进入宿管功能界面
				lb_tips.setText("登录成功!");
				loginTips();
				new DorAdminFunction(admin_num);
				HomePage.mainJFrame.dispose();
			}
			else {
    
     //若账号密码错误,则进行提示
				lb_tips.setText("账号或密码错误!");
				loginTips();
				try {
    
    
					HomePage.connection.close(); //关闭数据库连接
				} catch (SQLException e) {
    
    
					e.printStackTrace();
				}
			}
		}
	}
	
	public void studentLogin(String account,String password) {
    
     //学生登录
		boolean flag=false; //是否查找到相应账号密码
		String stu_num=null, pass; //学生账号密码
		try {
    
    
			String sql="SELECT stu_num, password FROM student"; //SQL语句
			PreparedStatement ps; //创建PreparedStatement类对象ps,用来执行SQL语句
			ps=HomePage.connection.prepareStatement(sql); //把操作数据库返回的结果保存到ps中
            ResultSet rs=ps.executeQuery(sql); //ResultSet类,用来存放获取的结果集
            while(rs.next()) {
    
     //遍历结果集
            	stu_num=rs.getString("stu_num");
                pass=rs.getString("password");
                if(account.equals(stu_num) && password.equals(pass)) {
    
    
                	flag=true;
                	break;
                }
            }
            rs.close();
            ps.close();
		}catch(SQLException e){
    
    
            e.printStackTrace();
        }
		if(flag) {
    
     //若学生账号密码正确,则进入学生功能界面
			lb_tips.setText("登录成功!");
			loginTips();
			new StudentFunction(stu_num);
			HomePage.mainJFrame.dispose();
		}
		else {
    
     //若账号密码错误,则进行提示
			lb_tips.setText("账号或密码错误!");
			loginTips();
			try {
    
    
				HomePage.connection.close(); //关闭数据库连接
			} catch (SQLException e) {
    
    
				e.printStackTrace();
			}
		}
	}
	
	public void loginTips() {
    
     //登录时弹出的提示信息窗口
		JDialog tips=new JDialog(HomePage.mainJFrame,"  提示",true);
		JPanel pn_tips=new JPanel();
		JButton bt_tips=new JButton("确 定");
		tips.setSize(450,200);
		tips.setLocationRelativeTo(null);
		tips.setResizable(false);
		tips.setLayout(null);
		pn_tips.setBounds(0,30,450,70);
		lb_tips.setFont(new Font("黑体",0,25));
		bt_tips.setFont(new Font("黑体",0,20));
		bt_tips.setBounds(175,100,100,50);
		bt_tips.setCursor(new Cursor(Cursor.HAND_CURSOR));
		pn_tips.add(lb_tips);
		tips.add(pn_tips);
		tips.add(bt_tips);
		bt_tips.addActionListener(new ActionListener() {
    
    
			public void actionPerformed(ActionEvent e) {
    
    
				tips.dispose();
			}
		});
		tips.setVisible(true);
	}
}

...
For other codes, please refer to the program source code!

postscript

This article is to record the author's own past, and at the same time for your reference. The article mainly shows the program functions. For detailed program code and introduction, please download the corresponding resources at the beginning of the article.

This program is for learning and reference only, please do not plagiarize or use it for other purposes.

Thank you for watching. If you have any questions, please comment in the comment area below. If you think this article is well written, please like it.

Follow me, watch more exciting! ( • ̀ω•́ )✧Like, comment, bookmark, follow

Guess you like

Origin blog.csdn.net/XiuMu_0216/article/details/125859958