基于JAVA 的智能图书管理系统(高阶版)

基本功能实现 :


可实现管理员 和 用户 两个界面的切换,实现管理员对读者用户的查找 ,信息修改 和对图书的查找 ,添加, 删除,和修改 。用户界面可对图书进行查询和借阅,归还书籍。该项目 包含java源代码,以及相关课程设计论文以及用户文档。 这样可以为用户提供更好的学习,该文档自己写了好久,经过不断调试进行完成的,该系统主要运用了JAVA的基本知识,连接数据进行实现的,本系统分图书查询、借还图书、图书管理、用户管理等四大功能模块,针对前社区机关、中小学等藏书在数万册以下的小型图书馆、图书室,从图书信息管理实际出发,在系统的开发背景、需求分析、设计原则及开发过程等四个方面进行了全面的阐述。 本系统是为图书馆量身定做的智能图书管理系统。在设计过程中最大限度满足用户的需求,因此,该系统具 有较强的实用性和针对性。本系统界面友好,操作简单,可维护性强,功能完备。

界面展示 :

主界面 :

 管理员界面

用户界面:

 还书:

 其他功能界面可一 一进行 不全部展示。

1 系统总体设计

 

实现了如下图书办理的基本功能:

  1、图书搜索模块:是图书所有体系中的主要模块之一--,能够让读者快速搜索到自己想看的书以及种类。

2、图书管理模块:是管理员操纵模块,用来管理。读者是无权进入的。

3、数据保护模块:是由图书管理员节制的模块,它由增添、修改和查看读者,增添、删除图书,阅读修改读者、阅读修改图书等内容构成。  

     这些在图书管理系统没有被开发出来之前,一直使用的传统的人工等级的方式来进行管理。不仅操作复杂,手续繁多,管理员所管理书籍的负担也很重,用已出现误差,新开发出的系统能让读者增加对读书的喜爱,减少管理员负担。

2 主要代码展示

package com.gui;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;

import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper;
import org.jb2011.lnf.beautyeye.ch3_button.BEButtonUI;

import com.database.LoginAction;
import com.entity.AdminInfor;
import com.entity.ReaderInfor;

public class Login implements ActionListener {
	/**
	 * 这个是登录的类,继承了ActionListener接口用于实现监听
	 * 功能:登录的界面窗口,可以选择读者登录或管理员登录
	 */
	private JFrame jf;
	private JPanel firstPanel;
	private JLabel userLabel;
	private JLabel passwordLabel;
	private JTextField userTextField;
	private JButton loginButton;
	private JButton exitButton;
	private JLabel background1;
	private JPasswordField passwordField;
	private JComboBox<String> identityBox;
	private JLabel identityJLabel;

	public void showLogin() {
		/*
		 * <p>这个函数用于显示登录界面</P> <p>采用的是绝对布局的方式</p>
		 */

		// 导入第三方包,更换系统皮肤
		try {
			org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
		} catch (Exception e) {
			System.out.println("ERROR");
		}		 
		try
	    {
	        //设置本属性将改变窗口边框样式定义
	        BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.translucencySmallShadow;
	        org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
	    }
	    catch(Exception e)
	    {
	        //TODO exception
	    }
		javax.swing.UIManager.put("RootPane.setupButtonVisible", false);

		/******************* 设置界面*******************/	
		jf = new JFrame("");
		jf.setResizable(false);
		jf.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		jf.setBounds(400, 100, 1000, 780);
		firstPanel = new JPanel();
		jf.setContentPane(firstPanel);
		firstPanel.setLayout(null); // 采用绝对定位,此句不能少
		firstPanel.setBounds(0, 0, jf.getWidth(), jf.getHeight());

		// 用户名
		userLabel = new JLabel("用户名");
		userLabel.setFont(new Font("宋体", Font.BOLD, 20));
		userLabel.setBounds(350, 300, 80, 20);
		userLabel.setForeground(Color.BLUE);
		firstPanel.add(userLabel);

		// 密码
		passwordLabel = new JLabel("密码");
		passwordLabel.setFont(new Font("宋体", Font.BOLD, 20));
		passwordLabel.setForeground(Color.BLUE);
		passwordLabel.setBounds(350, 350, 80, 20);
		firstPanel.add(passwordLabel);

		// 用户名文本框
		userTextField = new JTextField();
		userTextField.setFont(new Font("Dialog", Font.PLAIN, 15));
		userTextField.setBounds(450, 300, 167, 22);
		firstPanel.add(userTextField);
		userTextField.setColumns(10);

		// 密码文本框
		passwordField = new JPasswordField();
		passwordField.setFont(new Font("Dialog", Font.PLAIN, 15));
		passwordField.setBounds(450, 350, 167, 22);
		firstPanel.add(passwordField);

		// 身份
		identityJLabel = new JLabel("身份");
		identityJLabel.setBounds(350, 400, 50, 30);
		identityJLabel.setFont(new Font("宋体", Font.BOLD, 20));
		identityJLabel.setForeground(Color.blue);
		firstPanel.add(identityJLabel);

		// 身份下拉框
		String identity[] = new String[] { "管理员", "读者" };
		identityBox = new JComboBox<String>(identity);
		identityBox.setBounds(450, 400, 167, 30);
		firstPanel.add(identityBox);

		// 登录按钮
		loginButton = new JButton("登录");
		loginButton.setFont(new Font("Dialog", Font.BOLD, 17));
		loginButton.setUI(new BEButtonUI().setNormalColor(BEButtonUI.NormalColor.blue));
		loginButton.setForeground(Color.white);
		loginButton.setBounds(360, 480, 98, 36);
		firstPanel.add(loginButton);
		loginButton.addActionListener(this);
		loginButton.setActionCommand("login");

		// 退出按钮与监听
		exitButton = new JButton("退出");
		exitButton.setFont(new Font("Dialog", Font.BOLD, 17));
		exitButton.setUI(new BEButtonUI().setNormalColor(BEButtonUI.NormalColor.blue));
		exitButton.setForeground(Color.white);
		exitButton.setBounds(520, 480, 98, 36);
		firstPanel.add(exitButton);
		exitButton.addActionListener(this);
		exitButton.setActionCommand("exit");

		// 设置背景
		background1 = new JLabel(new ImageIcon("image/登录.jpg"));
		background1.setBounds(0, 0, firstPanel.getWidth(), firstPanel.getHeight());
		firstPanel.add(background1);

		jf.setVisible(true);
			
	}

public void actionPerformed(ActionEvent e) {

		if (e.getActionCommand().equals("exit")) {  // 退出
			jf.setVisible(false);
		}

		if (e.getActionCommand().equals("login")) { // 登录
			loginButton();
		}

	}

	public void loginButton() {
		/**
		 * 这个是登录按钮的事件的内容,将其写成一个函数,在登录按钮的监听中直接调用
		 */
		String identity = (String) identityBox.getSelectedItem();  // 身份
		// 账号
		String userString = userTextField.getText().toString();
		// 密码
		@SuppressWarnings("deprecation")
		String passwordString = passwordField.getText().toString();
		LoginAction loginAction = new LoginAction(userString, identity);

		if ("读者".equals(identity)) {  // 读者登录
			if (userString != null && !"".equals(userString)) {  // 账号不为空
				ReaderInfor readerInfor = new ReaderInfor();
				readerInfor = loginAction.getPassword();  // 到数据库获取密码
				if (!"".equals(readerInfor.getreaderId()) && readerInfor.getreaderId() != null
						&& readerInfor.getreaderPassword().equals(passwordString)) {
					jf.dispose();
					new ReaderMenu(userString); // 去读者界面,同时传递读者的id

				} else {
					JOptionPane.showMessageDialog(
							jf, "账号密码错误,请重新登录!",
							"提示", JOptionPane.WARNING_MESSAGE);
				}

			} else {
				JOptionPane.showMessageDialog(
						jf, "账号不能为空", 
						"提示", JOptionPane.WARNING_MESSAGE);
			}
		}else {    // 管理员登录
			if (userString != null && !"".equals(userString)) {
				AdminInfor adminInfor =new AdminInfor();
				adminInfor = loginAction.getAdminPassword();  // 到数据库获取密码
				if (!"".equals(adminInfor.getadminId()) && adminInfor.getadminId() != null
						&& adminInfor.getadminPassword().equals(passwordString)) {
					jf.dispose();
					new AdminMenu(adminInfor.getadminId());				

				} else {
					JOptionPane.showMessageDialog(
							jf, "账号密码错误,请重新登录!", "提示", JOptionPane.WARNING_MESSAGE);
				}

			} else {
				JOptionPane.showMessageDialog(jf, "账号不能为空",
						"提示", JOptionPane.WARNING_MESSAGE);
			}
		}

	}

}

 完整项目展示:

下载可转到:

基于JAVA的智能图书管理系统(高阶版)-Java文档类资源-CSDN下载

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

薛定谔狄喵

谢谢家人们的支持 ,感谢关照

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值