javaSwing日记管理系统

一、简介

使用 Java Swing 开发日记管理系统

在今天的博客中,我将向您介绍如何使用 Java Swing 开发一个简单而功能强大的日记管理系统。这个系统将具有登录、注册、找回密码、写日志以及切换主题等功能。我们将使用 MySQL 数据库来存储用户信息和日记内容。

二、技术栈

  • Java Swing:用于构建用户界面
  • MySQL:用于存储用户信息和日记内容
  • JDBC:用于 Java 与数据库的连接
  • SQL:用于数据库操作

三、数据库设计

首先,我们来设计数据库表结构。每个用户将有一张日记表,用于存储他们的日记内容。以下是数据库表的创建语句:

-- 用户表
create table users(
    username varchar(20) primary key,
    displayname varchar(20),
    pwd varchar(30),
    mail varchar(30),
    pwdprotectq int,
    pwdprotecta varchar(50),
    setting varchar(10) default 'summer'
);

-- 日记表示例
create table firstuser(
    date char(10),
    weather varchar(10),
    emotion varchar(20),
    title varchar(50),
    content varchar(5000)
);

四、功能介绍

请添加图片描述

登录

用户可以使用他们的用户名和密码登录系统。我们将验证用户名和密码是否匹配数据库中的记录。
请添加图片描述

注册

新用户可以注册一个账号。他们需要提供用户名、显示名称、密码、邮箱地址以及密码保护问题和答案。
请添加图片描述

找回密码

如果用户忘记了密码,他们可以通过密码保护问题来找回密码。

写日志

用户可以添加新的日记条目。每个日记包括日期、天气、心情、标题和内容。
请添加图片描述

查看日记

请添加图片描述

切换主题

用户可以根据自己的喜好切换系统主题。我们提供了春夏秋冬四种主题,用户可以按照心情或天气对日记进行排序。
请添加图片描述

实现步骤

  1. 连接数据库:使用 JDBC 连接到 MySQL 数据库。
  2. 登录和注册界面:创建登录和注册界面,收集用户信息并验证。
  3. 密码找回界面:允许用户通过密码保护问题找回密码。
  4. 主界面:展示用户的日记列表,并提供写日记和切换主题的功能。
  5. 写日记界面:让用户输入日记内容并保存到数据库。
  6. 切换主题功能:根据用户选择的主题,改变界面的外观和排序方式。

五、部分代码

DateChooser.java

package qifang.li.diaryui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFormattedTextField;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.border.LineBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

public class DateChooser extends JPanel implements ActionListener, ChangeListener {

	private static final long serialVersionUID = 1L;
	int startYear = 1980;
	int lastYear = 2050;
	int width = 270;
	int height = 200;
	Color backGroundColor = Color.gray;
	Color palletTableColor = Color.white;
	Color todayBackColor = Color.orange;
	Color weekFontColor = Color.blue ;
	Color dateFontColor = Color.black;
	Color weekendFontColor = Color.red ;
	Color controlLineColor = Theme.getMainColor();
	Color controlTextColor = Color.white ;
	Color rbFontColor = Color.white ;
	Color rbBorderColor = Color.red ;
	Color rbButtonColor = Color.pink;
	Color rbBtFontColor = Color.red ;
	JDialog dialog;
	JSpinner yearSpin;
	JSpinner monthSpin;
	JButton[][] daysButton = new JButton[6][7];
	JFormattedTextField jFormattedTextField;//显示当前选择日期的格式化输入框
	Calendar c = getCalendar();
	Calendar cal = Calendar.getInstance();
	int currentDay = cal.get(Calendar.DAY_OF_MONTH);
	
	DateChooser(JFormattedTextField jftf){
		jFormattedTextField = jftf;
		setLayout(new BorderLayout());
		setBorder(new LineBorder(backGroundColor,2));
		setBackground(backGroundColor);
		
		JPanel topYearAndMonth = createYearAndMonthPanal();
		add(topYearAndMonth,BorderLayout.NORTH);
		JPanel centerWeekAndDay = createWeekAndDayPanal();
		add(centerWeekAndDay,BorderLayout.CENTER);
	}
	private JPanel createYearAndMonthPanal() {
		int currentYear = c.get(Calendar.YEAR);
		int currentMonth = c.get(Calendar.MONTH)+1;
		
		JPanel result = new JPanel();
		result.setLayout(new FlowLayout());
		result.setBackground(controlLineColor);
		yearSpin = new JSpinner(new SpinnerNumberModel(currentYear,startYear,lastYear,1));
		yearSpin.setPreferredSize(new Dimension(60,20));
		yearSpin.setName("Year");
		yearSpin.addChangeListener(this);
		result.add(yearSpin);
		JLabel yearLabel = new JLabel("年");
		yearLabel.setForeground(controlTextColor);
		result.add(yearLabel);
		
		monthSpin = new JSpinner(new SpinnerNumberModel(currentMonth,1,12,1));
		monthSpin.setName("Month");
		monthSpin.addChangeListener(this);
		result.add(monthSpin);
		JLabel monthLabel = new JLabel("月");
		monthLabel.setForeground(controlTextColor);
		result.add(monthLabel);	
		return result;
	}
	private JPanel createWeekAndDayPanal() {
		String colname[] = {"日","一","二","三","四","五","六"};
		JPanel result = new JPanel();
		result.setFont(new Font("宋体",Font.PLAIN,12));
		result.setLayout(new GridLayout(7,7));
		result.setBackground(Color.white);
		JLabel cell;
		
		for(int i=0;i<7;i++) {
			cell = new JLabel(colname[i]);
			cell.setHorizontalAlignment(JLabel.CENTER);
			if(i==0||i==6) {
				cell.setForeground(weekendFontColor);
			}else {
				cell.setForeground(weekFontColor);
			}
			result.add(cell);
		}
		int actionCommandld = 0;
		for(int i=0;i<6;i++) {
			for(int j = 0;j<7;j++) {
				JButton numberButton = new JButton();
				numberButton.setBorder(null);
				numberButton.setHorizontalAlignment(SwingConstants.CENTER);
				numberButton.setActionCommand(String.valueOf(actionCommandld));
				numberButton.addActionListener(this);
				numberButton.setBackground(palletTableColor);
				numberButton.setForeground(dateFontColor);
				if(j ==0||j==6) {
					numberButton.setForeground(weekendFontColor);
				}else {
					numberButton.setForeground(dateFontColor);
				}
				daysButton[i][j] = numberButton;
				numberButton.addMouseListener(new MouseAdapter() {
					public void mouseClicked(MouseEvent e) {
						if(e.getClickCount() ==2) {
							closeAndSetDate();
						}
					}
				});
				result.add(numberButton);
				actionCommandld++;
			}						
		}	
		return result;
	}
	
	private JDialog createDialog(Frame owner) {
		JDialog result = new JDialog(owner,"日期时间选择器",true);
		result.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
		result.getContentPane().add(this, BorderLayout.CENTER);
		result.pack();
		result.setSize(width, height);
		return result;
	}
	public void showDateChooser(Point position) {
		Object tmpobj = SwingUtilities.getWindowAncestor(jFormattedTextField);
		if(tmpobj.getClass().isInstance(new JDialog())||tmpobj.getClass().getSuperclass().isInstance(new JDialog())) {
			JDialog ownerdialog = (JDialog)SwingUtilities.getWindowAncestor(jFormattedTextField);
			Frame owner = (Frame)SwingUtilities.getWindowAncestor(ownerdialog);
			if(dialog == null || dialog.getOwner() != owner) {
				dialog = createDialog(owner);
			}
			dialog.setLocation(getAppropriateLocation(owner,position));
		}
		else if(tmpobj.getClass().isInstance(new JFrame())||tmpobj.getClass().getSuperclass().isInstance(new JFrame())) {
			JFrame ownerFrame = (JFrame)SwingUtilities.getWindowAncestor(jFormattedTextField);
			if(dialog == null || dialog.getOwner() != ownerFrame) {
				dialog = createDialog(ownerFrame);
			}
			dialog.setLocation(getAppropriateLocation(ownerFrame,position));
		}
		flushWeekAndDay();
		dialog.setVisible(true);
	}
	Point getAppropriateLocation(Frame owner, Point position) {
		Point result = new Point(position);
		Point p  = owner.getLocation();
		int offsetX = (position.x + width) - (p.x = owner.getWidth());
		int offsetY = (position.y + height) - (p.y + owner.getHeight());
		
		if(offsetX > 0) {
			result.x -= offsetX;
		}
		if(offsetY > 0) {
			result.y -= offsetY;
		}
		return result;
	}
	public void closeAndSetDate() {
		setDate(c.getTime());
		dialog.dispose();
	}	
	private Calendar getCalendar() {
		Calendar result = Calendar.getInstance();
		result.setTime(getDate());
		return result;
	}
	private int getSelectedYear() {
		return ((Integer)yearSpin.getValue()).intValue();
	}
	private int getSelectedMonth() {
		return ((Integer)monthSpin.getValue()).intValue();
	}
	private void dayColorUpdate(boolean isOldDay) {
		int day = c.get(Calendar.DAY_OF_MONTH);
		c.set(Calendar.DAY_OF_MONTH, currentDay);
		int actionCommandld = day -2 + c.get(Calendar.DAY_OF_WEEK);
		int i = actionCommandld / 7;
		int j = actionCommandld % 7;
		if(isOldDay) {
			daysButton[i][j].setForeground(dateFontColor);
		}else {
			daysButton[i][j].setForeground(todayBackColor);
		}
	}
	private void flushWeekAndDay() {
		c.set(Calendar.DAY_OF_MONTH,currentDay);
		int maxDayNo = c.getActualMaximum(Calendar.DAY_OF_MONTH);
		int dayNo = 2 - c.get(Calendar.DAY_OF_WEEK);
		for(int i=0; i<6;i++) {
			for(int j=0;j<7;j++) {
				String s = "";
				if(dayNo >= 1 && dayNo <= maxDayNo) {
					s = String.valueOf(dayNo);					
				}
				daysButton[i][j].setText(s);
				dayNo++;
			}
		}
		dayColorUpdate(false);
	}
	public void setDate(Date date) {
		jFormattedTextField.setText(getDefaultDateFormat().format(date));
	}
	public Date getDate() {
		try {
			String dateString = jFormattedTextField.getText();
			return getDefaultDateFormat().parse(dateString);
		}catch(ParseException e){
			return getNowDate();
		}catch(Exception ee) {
			return getNowDate();
		}
	}
	private static Date getNowDate() {
		return Calendar.getInstance().getTime();
	}
	private static SimpleDateFormat getDefaultDateFormat() {
		return new SimpleDateFormat("yyyy-MM-dd");
	}
	
	@Override
	public void stateChanged(ChangeEvent e) {
		// TODO Auto-generated method stub
		JSpinner source = (JSpinner)e.getSource();
		dayColorUpdate(true);
		if(source.getName().equals("Year")) {
			c.set(Calendar.YEAR, getSelectedYear());
		}
		if(source.getName().equals("Month")) {
			c.set(Calendar.MONDAY, getSelectedMonth()-1);
		}
		flushWeekAndDay();
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		JButton source = (JButton)e.getSource();
		if (source.getText().length() == 0) {
			return;
		}
		dayColorUpdate(true);
		source.setForeground(todayBackColor);
		int newDay = Integer.parseInt(source.getText());
		c.set(Calendar.DAY_OF_MONTH, newDay);
	}
	
	

}

FindPwdUI.java


package qifang.li.diaryui;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.Box;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class FindPwdUI {
	private JPanel findPwdJP = new JPanel(){
		private static final long serialVersionUID = 120000L;
		protected void paintComponent(Graphics g) {
        	super.paintComponent(g);
            ImageIcon icon = Theme.getImage();
            // 图片随窗体大小而变化
            g.drawImage(icon.getImage(), 0, 0,getWidth(),getHeight(),this);
        }
	};
	private JTextField userNameField = new JTextField();
	private JPasswordField passwordField1 = new JPasswordField();
	private JPasswordField passwordField2 = new JPasswordField();
	String[] question = new String[] { "你父亲的名字是?", "你母亲的名字是?", "你的小名是?" ,"你最好的朋友是?","你最喜欢的颜色是?"};
	private JComboBox questionSelector = new JComboBox(question);
	private JTextField anwserField = new JTextField();
	private JButton enterBn = new JButton("确定");
	private JButton cancelBn = new JButton("取消");
	
	public FindPwdUI() {
		init();
	}
	
	public void clearFindPedPage() {
		userNameField.setText("");
		passwordField1.setText("");
		passwordField2.setText("");
		anwserField.setText("");
		questionSelector.setSelectedIndex(0);
	}
	
	public void init() {
		GridBagLayout gbLayout = new GridBagLayout(); 
		GridBagConstraints gbCons = new GridBagConstraints();
		findPwdJP.setLayout(gbLayout);
		findPwdJP.setFocusable(false);
		userNameField.addFocusListener(new JTextFieldHintListener(userNameField,"用户名6~20个字符"));
		
		userNameField.setPreferredSize(new Dimension(200,30));
		passwordField1.setPreferredSize(new Dimension(200,30));
		passwordField2.setPreferredSize(new Dimension(200,30));
		questionSelector.setPreferredSize(new Dimension(200,30));
		anwserField.setPreferredSize(new Dimension(200,30));
		
		gbCons.fill = GridBagConstraints.BOTH;
		gbCons.insets = new Insets(10, 50, 5, 10);
		gbCons.weightx = 0;
		gbCons.weighty = 0;
		gbCons.gridx = 0;
		gbCons.gridy = 0;
		gbCons.gridwidth = 1;
		gbCons.gridheight = 1;
		findPwdJP.add(new JLabel("用  户  名:"),gbCons);
		Box nameBox = Box.createHorizontalBox();	
		gbCons.insets = new Insets(10, 0, 5, 50);
		nameBox.add(userNameField);
		gbCons.weightx = 1;
		gbCons.gridx = 1;
		findPwdJP.add(nameBox, gbCons);
		
		gbCons.insets = new Insets(5, 50, 5, 10);
		gbCons.weightx = 0;
		gbCons.gridx = 0;
		gbCons.gridy = 2;
		findPwdJP.add(new JLabel("密保问题:"),gbCons);
		gbCons.insets = new Insets(5, 0, 5, 50);
		gbCons.weightx = 1;
		gbCons.gridwidth = 1;
		gbCons.weightx = 0;
		gbCons.gridx = 1;
		gbCons.gridy = 2;
		findPwdJP.add(questionSelector,gbCons);
		
		gbCons.insets = new Insets(5, 50, 5, 10);
		gbCons.gridwidth = 1;
		gbCons.weightx = 0;
		gbCons.gridx = 0;
		gbCons.gridy = 3;
		findPwdJP.add(new JLabel("问题答案:"),gbCons);
		Box Box6 = Box.createHorizontalBox();	
		gbCons.insets = new Insets(5, 0, 5, 50);
		Box6.add(anwserField);
		gbCons.weightx = 1;
		gbCons.gridx = 1;
		gbCons.gridy = 3;
		findPwdJP.add(Box6, gbCons);
		
		gbCons.insets = new Insets(5, 0, 5, 5);
		gbCons.weightx = 0;
		gbCons.gridx = 1;
		gbCons.gridy = 4;
		gbCons.gridwidth = 1;
		findPwdJP.add(new JLabel("*密码长度8~30个字符,必须同时包含数字、字母、特殊字符"),gbCons);
		
		gbCons.insets = new Insets(5, 50, 5, 10);
		gbCons.weightx = 0;
		gbCons.gridx = 0;
		gbCons.gridy = 5;
		gbCons.gridwidth = 1;
		findPwdJP.add(new JLabel("新  密  码:"),gbCons);		
		Box Box2 = Box.createHorizontalBox();	
		gbCons.insets = new Insets(5, 0, 5, 50);
		Box2.add(passwordField1);
		gbCons.weightx = 1;
		gbCons.gridx = 1;
		gbCons.gridy = 5;
		findPwdJP.add(Box2, gbCons);
		
		gbCons.insets = new Insets(5, 50, 5, 10);
		gbCons.weightx = 0;
		gbCons.gridx = 0;
		gbCons.gridy = 6;
		findPwdJP.add(new JLabel("确认密码:"),gbCons);		
		Box Box3 = Box.createHorizontalBox();	
		gbCons.insets = new Insets(5, 0, 5, 50);
		Box3.add(passwordField2);
		gbCons.weightx = 1;
		gbCons.gridx = 1;
		gbCons.gridy = 6;
		findPwdJP.add(Box3, gbCons);
				
		gbCons.fill = GridBagConstraints.NONE;	
		gbCons.insets = new Insets(5, 50, 5, 10);
		gbCons.weightx = 0;
		gbCons.gridx = 0;
		gbCons.gridy = 7;
		enterBn.setBackground(Theme.getMainColor());
		enterBn.setForeground(Color.white);
		findPwdJP.add(enterBn,gbCons);
		gbCons.anchor = GridBagConstraints.WEST;
		gbCons.insets = new Insets(5, 0, 5, 50);
		gbCons.weightx = 0;
		gbCons.gridx = 1;
		gbCons.gridy = 7;
		cancelBn.setContentAreaFilled(false);
		cancelBn.setForeground(Theme.getMainColor());
		findPwdJP.add(cancelBn,gbCons);
	}
	public JTextField getUserNameField() {
		return userNameField;
	}
	public void setUserNameField(JTextField userNameField) {
		this.userNameField = userNameField;
	}
	public JPasswordField getPasswordField1() {
		return passwordField1;
	}
	public void setPasswordField1(JPasswordField passwordField1) {
		this.passwordField1 = passwordField1;
	}
	public JPasswordField getPasswordField2() {
		return passwordField2;
	}
	public void setPasswordField2(JPasswordField passwordField2) {
		this.passwordField2 = passwordField2;
	}
	public String[] getQuestion() {
		return question;
	}
	public void setQuestion(String[] question) {
		this.question = question;
	}
	public JComboBox getQuestionSelector() {
		return questionSelector;
	}
	public void setQuestionSelector(JComboBox questionSelector) {
		this.questionSelector = questionSelector;
	}
	public JTextField getAnwserField() {
		return anwserField;
	}
	public void setAnwserField(JTextField anwserField) {
		this.anwserField = anwserField;
	}
	public JButton getEnterBn() {
		return enterBn;
	}
	public void setEnterBn(JButton enterBn) {
		this.enterBn = enterBn;
	}
	public JButton getCancelBn() {
		return cancelBn;
	}
	public void setCancelBn(JButton cancelBn) {
		this.cancelBn = cancelBn;
	}
	public void setFindPwdJP(JPanel findPwdJP) {
		this.findPwdJP = findPwdJP;
	}
	public JPanel getFindPwdJP() {
		return findPwdJP;
	}
}

Login.java

package qifang.li.diaryui;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class LoginUI {
	private JPanel loginJP = new JPanel(){
		private static final long serialVersionUID = 2L;
		protected void paintComponent(Graphics g) {
        	super.paintComponent(g);
            ImageIcon icon = Theme.getImage();
            // 图片随窗体大小而变化
            g.drawImage(icon.getImage(), 0, 0,getWidth(),getHeight(),this);
        }
	};
	private JTextField userNameField = new JTextField();
	private JPasswordField passwordField = new JPasswordField();
	private JButton loginBn = new JButton("登录");
	private JButton signUpBn = new JButton("注册");
	private JButton findBn = new JButton("找回密码");

	public LoginUI() {
		init();
	}
	public void init() {
		userNameField.addFocusListener(new JTextFieldHintListener(userNameField,"用户名6~20个字符"));
		GridBagLayout gbLayout = new GridBagLayout(); 
		GridBagConstraints gbCons = new GridBagConstraints();
		loginJP.setLayout(gbLayout);
		loginJP.setFocusable(false);
		
		gbCons.fill = GridBagConstraints.BOTH;
		gbCons.insets = new Insets(20, 20, 10, 5);
		gbCons.weightx = 0;
		gbCons.weighty = 0;
		gbCons.gridx = 0;
		gbCons.gridy = 0;
		gbCons.gridwidth = 1;
		gbCons.gridheight = 1;
		loginJP.add(new JLabel("用户名:"),gbCons);
				
		Box nameBox = Box.createHorizontalBox();	
		gbCons.insets = new Insets(20, 5, 10, 5);
		userNameField.setOpaque(false);
		nameBox.add(userNameField);
		gbCons.weightx = 1;
		gbCons.gridx = 1;
		loginJP.add(nameBox, gbCons);
		
		gbCons.insets = new Insets(20, 5, 10, 20);
		gbCons.weightx = 0;
		gbCons.gridx = 2;
		gbCons.gridy = 0;	
		signUpBn.setContentAreaFilled(false);
		signUpBn.setForeground(Theme.getMainColor());
		loginJP.add(signUpBn, gbCons);
		
		gbCons.insets = new Insets(10, 20, 10, 5);
		gbCons.gridx = 0;
		gbCons.gridy = 1;
		loginJP.add(new JLabel("密    码:"),gbCons);
		
		Box pwdBox = Box.createHorizontalBox();
		gbCons.insets = new Insets(10, 5, 10, 5);
		passwordField.setOpaque(false);
		pwdBox.add(passwordField);
		gbCons.weightx = 1;
		gbCons.gridx = 1;
		gbCons.gridy = 1;		
		loginJP.add(pwdBox, gbCons);
		
		gbCons.insets = new Insets(10, 5, 10, 20);
		gbCons.weightx = 0;
		gbCons.gridx = 2;
		gbCons.gridy = 1;	
		findBn.setContentAreaFilled(false);
		findBn.setForeground(Theme.getMainColor());
		loginJP.add(findBn, gbCons);
		
		gbCons.insets = new Insets(10, 5, 0, 5);
		gbCons.weightx = 0;
		gbCons.weighty = 0;
		gbCons.gridx = 1;
		gbCons.gridy = 2;		
		loginBn.setBackground(Theme.getMainColor());
		loginBn.setForeground(Color.white);
		loginJP.add(loginBn, gbCons);		
		
		userNameField.addMouseListener(new MouseFieldListener());
		passwordField.addMouseListener(new MouseFieldListener());
	}
	
	class MouseFieldListener extends MouseAdapter{
		@Override
		public void mouseExited(MouseEvent e) {// 鼠标退出组件
			((JTextField)e.getSource()).setBorder(BorderFactory.createLineBorder(Color.white));
			
		}
		@Override
		public void mouseEntered(MouseEvent e) {// 鼠标进入组件
			((JTextField)e.getSource()).setBorder(BorderFactory.createLineBorder(Theme.getMainColor()));
		}
	}
	
	
	public JPanel getLoginJP() {
		return loginJP;
	}
	public JButton getloginBn() {
		return loginBn;
	}
	public JButton getSignUpBn() {
		return signUpBn;
	}
	public JButton getFindBn() {
		return findBn;
	}
	public JTextField getUserNameField() {
		return userNameField;
	}
	public JTextField getPasswordField() {
		return passwordField;
	}	
	
}

六、联系与交流

q:969060742  sql 、 完整代码、程序资源

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/475934.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

ShardingSphere+JPA+Druid实现分表操作

要在SpringBoot项目中实现分表操作&#xff0c;本文使用的是ShardingSphereJPADruid实现。过程中出现问题记录一下。 准备MySQL数据库表 这里准备的是一张主表test_cost&#xff0c;两张从表test_cost_0和test_cost_1&#xff0c;结构需要相同&#xff0c;主表只是声明了表结构…

python异常:pythonIOError异常python打开文件异常

1.python读取不存在的文件时&#xff0c;抛出异常 通过 open()方法以读“r”的方式打开一个 abc.txt 的文件&#xff08;该文件不存在&#xff09;&#xff0c;执行 open()打开一个不存在的文件时会抛 IOError 异常&#xff0c;通过 Python 所提供的 try...except...语句来接收…

基于springBoot 整合JavaMail的网站邮件通知功能实现

JDK版本&#xff1a;jdk17 IDEA版本&#xff1a;IntelliJ IDEA 2022.1.3 SpringBoot 版本&#xff1a;v2.5.7 文章目录 一、关于邮件发送的基本概念1.1 邮件发送1.1.1 SMTP协议 1.2 邮件接收1.2.1 POP3协议1.2.2 IMAP协议 二、准备工作2.1 注册邮箱2.1 获取登录授权码 三、开发…

走进jvm之垃圾回收器篇

这里我想首先说明一下&#xff0c;虽然我们经常会拿垃圾回收器来做比较&#xff0c;虽然想挑选一个最好的收集器出来&#xff0c;但是目前也没有说哪一款收集器是完美的&#xff0c;更不存在万能的收集器&#xff0c;我们也只是对收集器选择最适合场景的一个收集器。 那么作者将…

Springboot+Vue前后端分离的在线图书商城(书城)系统

项目介绍 现代经济快节奏发展以及不断完善升级的信息化技术&#xff0c;让传统数据信息的管理升级为软件存储&#xff0c;归纳&#xff0c;集中处理数据信息的管理方式。本图书商城管理系统就是在这样的大环境下诞生&#xff0c;其可以帮助管理者在短时间内处理完毕庞大的数据…

UE snap02 解析ASCII文本文件

UE snap02 解析ASCII文本文件 示例数据data.dat 11389477.2714892 3364559.73645693 0 11389471.5162524 3364567.8860295 0 11389471.5162524 3365813.09618369 0 11388329.6082659 3366184.85895869 0 11388320.4775297 3366197.78833087 0 11388270.6882384 3366214.84811…

OpenAI Sora文生视频模型技术报告中英全文

Video generation models as world simulators 视频生成模型作为世界模拟器 We explore large-scale training of generative models on video data. Specifically, we train text-conditional diffusion models jointly on videos and images of variable durations, resolu…

jQuery 元素操作

文章目录 1. jQuery 样式操作1.1 操作 css 方法1.2 设置类样式方法*案例--tab栏切换 1.3 类操作和className 区别 2. jQuery 效果2.1 显示隐藏效果2.2 滑动效果事件切换动画队列及其停止排队方法 3.3 淡入淡出效果利用渐进方式调整透明度*案例--高亮突出显示 3.4 自定义动画 an…

国务院办公厅发布:政府类网站网页设计规范(试行)

国务院办公厅于2019年12月发布了《政府类网站网页设计规范&#xff08;试行&#xff09;》。该规范的发布旨在统一政府类网站的设计风格和标准&#xff0c;提升政府网站的用户体验和可访问性&#xff0c;推动政府信息公开和服务的提升。 该规范涵盖了政府类网站的各个方面&…

Java IO流(超详细!)上篇

目录 一、File类1、操作文件和目录 二、I/O流概述1、按流向划分&#xff1a;输入流和输出流2、按处理单元划分&#xff1a;字节流和字符流3、按流的角色划分&#xff1a;节点流和处理流 三、字节流1、字节输出流基类&#xff1a;OutputStream2、字节输出流FileOutputStream类3、…

未来已来?国内10家AI大模型盘点(附体验网址)

名人说&#xff1a;莫道桑榆晚&#xff0c;为霞尚满天。——刘禹锡&#xff08;刘梦得&#xff0c;诗豪&#xff09; 创作者&#xff1a;Code_流苏(CSDN)&#xff08;一个喜欢古诗词和编程的Coder&#x1f60a;&#xff09; 目录 1、阿里云——通义千问2、科大讯飞——星火大模…

全局过滤器实现Jwt校验

从Session到Jwt 之前我写过一篇 什么是 httpsession &#xff1a; 理解HttpSession 在经典的那个登录场景中&#xff1a; 客户端第一次访问的时候 需要登录 登录成功之后 后面再次访问的时候 为了让服务器认识 这是已经登录成功的我 在session中存储的用户的信息。 现在我…

【leetcode】628.三个数的最大乘积

前言&#xff1a;剑指offer刷题系列 问题&#xff1a; 给你一个整型数组 nums &#xff0c;在数组中找出由三个数组成的最大乘积&#xff0c;并输出这个乘积。 示例&#xff1a; 输入&#xff1a;nums [1,2,3] 输出&#xff1a;6思路1&#xff1a; 先去计算输入列表 nums …

蓝桥杯刷题(十三)

1.煤球数目 代码 cnt ans 0 start 1 a [] while cnt<100:ansstartstart 1t ansstartcnt1a.append(ans) print(sum(a))2.奖券数目 代码 def f(x)->bool:while x:if x%104:return Falsex//10return True ans 0 for i in range(10000,100000):if f(i):ans1 print(a…

鸿蒙实战开发:【国际化部件】

简介 国际化部件为应用提供了一系列国际化接口&#xff0c;包括&#xff1a;时间日期格式化、数字格式化、月份星期格式化、单复数、度量衡等相关接口。基于这些国际化接口&#xff0c;开发者可以设计并实现具有良好国际化能力的应用&#xff0c;从而可以高效、低成本的实现应…

(一)基于IDEA的JAVA基础4

注释文本&#xff0c;注释模版 单行注释://开头放在代码前面&#xff0c;对少部分。 多行注释:快捷方式ctrlshift/,对段落代码注 释。 文档注释:/**……**/&#xff0c;用于声明作者或创作时 间。 文档注释如何设置&#xff0c;首先找到File中…

[flask]flask的路由

路由的基本定义 路由就是一种映射关系。是绑定应用程序&#xff08;视图&#xff09;和url地址的一种一对一的映射关系&#xff01;在开发过程中&#xff0c;编写项目时所使用的路由往往是指代了框架/项目中用于完成路由功能的类&#xff0c;这个类一般就是路由类&#xff0c;…

vscode git图形化使用教程(一文秒懂,快速上手)

vscode git图形化使用教程&#xff08;一文秒懂&#xff0c;快速上手&#xff09; vscode 图形化 git  ​ 右键 checkout 功能&#xff0c;切换到当前分支 &#xff08;如果想要切换分支&#xff0c;必须要先上传当前更改的再切换分支&#xff0c;切换完分支后变为之前分支内…

网络编程3.21作业

1.现象 1.增 2.删 3.改 4.查 2.源码 #include<myhead.h>int callback(void* arg,int a,char **msgtext,char **msgheader){if(*(int *)arg0){for(int i0;i<a;i){printf("%s\t",*(msgheaderi));}printf("\n");}for(int i0;i<a;i){printf(&quo…

【Linux】深入了解Linux磁盘配额:限制用户磁盘空间的利器

&#x1f34e;个人博客&#xff1a;个人主页 &#x1f3c6;个人专栏&#xff1a;Linux ⛳️ 功不唐捐&#xff0c;玉汝于成 前言 在多用户环境下管理磁盘空间是服务器管理中的一项重要任务。Linux提供了强大的磁盘配额功能&#xff0c;可以帮助管理员限制用户或组对文件系统…