欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Java實現(xiàn)簡易圖書借閱系統(tǒng)

 更新時間:2022年03月11日 09:39:09   作者:禿頭也打碼  
這篇文章主要為大家詳細(xì)介紹了Java實現(xiàn)簡易圖書借閱系統(tǒng),文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下

在簡單學(xué)習(xí)Java的基礎(chǔ)知識點后,動手做了一個十分簡陋的圖書館借閱系統(tǒng),作為對所學(xué)知識的綜合應(yīng)用,有不足的地方希望大家多多評論,會積極進(jìn)行改正。

1.先附上總的效果

一開始的登錄界面

登錄界面

注冊界面

登錄進(jìn)去后的個人主頁

(本來想在上方插入一張圖片,但是剛學(xué)swing部分,搞不懂圖片的插入方式,搞了很久還是沒懂,就暫時放下了)

借書頁面

輸入關(guān)鍵詞后搜索的結(jié)果

還書界面,點擊自動顯示未還書籍

查詢未還書籍的具體信息

2.貼上源代碼

1).這里簡單說一下與數(shù)據(jù)庫的操作,注冊用戶時在表person_information插入個人信息,注冊的同時創(chuàng)建專屬個人的 賬號+密碼_no_book_information 表記錄未還書籍 ,還有 賬號+密碼_already_book_information 表記錄已還書籍的信息記錄,在借書時將書籍的信息插入賬號+密碼_no_book_information 表,在還書時在
賬號+密碼_already_book_information 表插入已還書籍的信息,刪除賬號+密碼_no_book_information 表中對應(yīng)的借閱記錄。

2).首先做了一個初始化連接數(shù)據(jù)庫的類,方便在需要時調(diào)用。
(涉及數(shù)據(jù)庫方面只是簡單的增刪查改,本人也是剛學(xué),不做過多的說明)

package booksystem;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/*
?* 用于初始化連接數(shù)據(jù)庫
?*/
public class jdbcConnection?
{
?? ?public static Connection getConnection()throws SQLException
?? ?{
?? ??? ?try
?? ??? ?{
?? ??? ??? ?Class.forName("com.mysql.jdbc.Driver");
?? ??? ??? ?
?? ??? ?}
?? ??? ?catch(ClassNotFoundException e)
?? ??? ?{
?? ??? ??? ?e.printStackTrace();
?? ??? ??? ?System.exit(0);
?? ??? ?}
?? ??? ?
?? ??? ?return DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/book_system?characterEncoding=UTF-8","root","123456789");
?? ??? ?
?? ?}

}

登錄界面

主要思路:

登錄時在數(shù)據(jù)庫中搜索是否存在該賬戶,存在進(jìn)入主頁,不存在則提示錯誤,注冊時在數(shù)據(jù)庫的用戶列表插入新用戶的信息。

package booksystem;
import javax.swing.*;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/*
?* 圖書館登錄界面的設(shè)計
?* 包括 登錄和注冊兩部分
?*?
?*/
@SuppressWarnings("serial")
public class jieMian extends JFrame ??//總頁面
{
?? ??? ?
?? ?public jieMian()
?? ?{
?? ??? ?super();
?? ??? ?
?? ??? ?JLabel label=new JLabel("歡迎來到圖書館借閱系統(tǒng)");
?? ??? ?label.setFont(new Font("宋體", 0?? ?,25));
?? ??? ?label.setBounds(100,50,300,150);
?? ??? ?
?? ??? ?
?? ??? ?JButton button=new JButton("登錄");
?? ??? ?button.addActionListener(new ActionListener()
?? ??? ??? ??? ?{

?? ??? ??? ??? ??? ?@Override
?? ??? ??? ??? ??? ?public void actionPerformed(ActionEvent e)?
?? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ?new dengLu();
?? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ?
?? ??? ??? ??? ?});
?? ??? ?
?? ??? ?JButton button1=new JButton("注冊");
?? ??? ?button1.addActionListener(new ActionListener()
?? ??? ??? ??? ?{

?? ??? ??? ??? ??? ?@Override
?? ??? ??? ??? ??? ?public void actionPerformed(ActionEvent e)?
?? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ?new zhuCe();
?? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ?
?? ??? ??? ??? ?});
?? ??? ?
?? ??? ?Box box=Box.createVerticalBox();
?? ??? ?box.add(button);
?? ??? ?box.add(Box.createVerticalStrut(50));
?? ??? ?box.add(button1);
?? ??? ?box.setBounds(200,250,100,150);
?? ??? ?
?? ??? ?
?? ??? ?setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
?? ??? ?setSize(500,500);
?? ??? ?setResizable(false);
?? ??? ?setLocation(700,200);
?? ??? ?setVisible(true);
?? ??? ?setLayout(null);
?? ??? ?add(label);
?? ??? ?add(box);
?? ??? ?
?? ?}
?? ?
?? ?//注冊頁面
?? ?
?? ?class zhuCe extends JFrame implements ActionListener
?? ?{
?? ??? ?private JTextField zhangHao2;
?? ??? ?private JPasswordField password2;
?? ??? ?
?? ??? ?public zhuCe()
?? ??? ?{
?? ??? ??? ?super();
?? ??? ??? ?
?? ??? ??? ?Box box=Box.createHorizontalBox();
?? ??? ??? ?zhangHao2=new JTextField(15);
?? ??? ??? ?box.add(new JLabel("賬號:"));
?? ??? ??? ?box.add(Box.createHorizontalStrut(10));
?? ??? ??? ?box.add(zhangHao2);
?? ??? ??? ?
?? ??? ??? ?Box box1=Box.createHorizontalBox();
?? ??? ??? ?password2=new JPasswordField(15);
?? ??? ??? ?box1.add(new JLabel("密碼:"));
?? ??? ??? ?box1.add(Box.createHorizontalStrut(10));
?? ??? ??? ?box1.add(password2);?
?? ??? ??? ?
?? ??? ??? ?
?? ??? ??? ?JButton button=new JButton("確認(rèn)");
?? ??? ??? ?button.addActionListener(this);
?? ??? ??? ?
?? ??? ??? ?JButton button1=new JButton("重置");
?? ??? ??? ?button1.addActionListener(this);
?? ??? ??? ?
?? ??? ??? ?Box box2=Box.createHorizontalBox();
?? ??? ??? ?box2.add(Box.createHorizontalStrut(30));
?? ??? ??? ?box2.add(button);
?? ??? ??? ?box2.add(Box.createHorizontalStrut(70));
?? ??? ??? ?box2.add(button1);
?? ??? ??? ?
?? ??? ??? ?Box box3=Box.createVerticalBox();
?? ??? ??? ?box3.add(box);
?? ??? ??? ?box3.add(Box.createVerticalStrut(10));
?? ??? ??? ?box3.add(box1);
?? ??? ??? ?box3.add(Box.createVerticalStrut(10));
?? ??? ??? ?box3.add(box2);
?? ??? ??? ?box3.setBounds(100,50,250,100);
?? ??? ??? ?
?? ??? ??? ?setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
?? ??? ??? ?setSize(500,250);
?? ??? ??? ?setLayout(null);
?? ??? ??? ?setVisible(true);
?? ??? ??? ?setLocation(700,300);
?? ??? ??? ?add(box3);
?? ??? ??? ?
?? ??? ??? ?
?? ??? ?}

?? ??? ?//事件處理
?? ??? ?@Override
?? ??? ?public void actionPerformed(ActionEvent e) ?
?? ??? ?{
?? ??? ??? ?String ret=e.getActionCommand();
?? ??? ??? ?
?? ??? ??? ?if(ret.equals("確認(rèn)"))
?? ??? ??? ?{
?? ??? ??? ??? ?//需要插入一個檢驗數(shù)據(jù)合理性并更新數(shù)據(jù)庫的操作
?? ??? ??? ??? ?String insertzh=zhangHao2.getText();
?? ??? ??? ??? ?String insertpw=new String(password2.getPassword());
?? ??? ??? ??? ?insert(insertzh,insertpw); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //點擊確認(rèn)后插入數(shù)據(jù)自動關(guān)閉
?? ??? ??? ??? ?this.dispose();
?? ??? ??? ??? ?
?? ??? ??? ?}
?? ??? ??? ?else
?? ??? ??? ?{
?? ??? ??? ??? ?zhangHao2.setText("");
?? ??? ??? ??? ?password2.setText("");
?? ??? ??? ?}
?? ??? ?}
?? ??? ?
?? ??? ?
?? ??? ?//處理注冊賬號密碼并插入數(shù)據(jù)庫
?? ??? ?//這里只是簡單地將賬號密碼插入數(shù)據(jù)庫,沒有考慮若賬號不能與之前的用戶相同還有不能用空格注冊。
?? ??? ?//處理空格的方法:提取原始賬號密碼,用trim()除去前后空格比較長度做第一輪篩選,再逐個字符進(jìn)行比較
?? ??? ?private void insert(String zh,String pw)
?? ??? ?{
?? ??? ??? ?try(
?? ??? ??? ?Statement statement=jdbcConnection.getConnection().createStatement();
?? ??? ??? ?)
?? ??? ??? ?{
?? ??? ??? ??? ?String sqlsentence="insert into person_information values('"+zh+"','"+pw+"',now());";
?? ??? ??? ??? ?statement.execute(sqlsentence);
?? ??? ??? ??? ?
?? ??? ??? ??? ?String sqlsentence1="create table "+zh+pw+"_no_book_information(書名 varchar(20) not null," ? ? ? //建立一個個人的借書未還表
?? ??? ??? ??? ??? ??? ?+ "借書時間 ?datetime not null,"
?? ??? ??? ??? ??? ??? ?+ "借閱天數(shù) ?int unsigned not null,"
?? ??? ??? ??? ??? ??? ?+ "應(yīng)還時間 ?datetime not null);";
?? ??? ??? ??? ?statement.execute(sqlsentence1);
?? ??? ??? ??? ?
?? ??? ??? ??? ?//建立已還書籍記錄
?? ??? ??? ??? ?String sqlsentence2="create table "+zh+pw+"_already_book_information(書名 varchar(20) not null," ? ? ? //建立一個個人的借書未還表
?? ??? ??? ??? ??? ??? ?+ "借書時間 ?datetime not null,"
?? ??? ??? ??? ??? ??? ?+ "借閱天數(shù) ?int unsigned not null,"
?? ??? ??? ??? ??? ??? ?+ "應(yīng)還時間 ?datetime not null,"
?? ??? ??? ??? ??? ??? ?+ "歸還時間 ? datetime ?not null);"; ?
?? ??? ??? ??? ?statement.execute(sqlsentence2);
?? ??? ??? ??? ?
?? ??? ??? ?}
?? ??? ??? ?catch(SQLException e)
?? ??? ??? ?{
?? ??? ??? ??? ?System.out.println("注冊賬號更新數(shù)據(jù)庫時出錯!");
?? ??? ??? ??? ?e.printStackTrace();
?? ??? ??? ??? ?System.exit(0);
?? ??? ??? ??? ?
?? ??? ??? ?}
?? ??? ?}? ? ? ?
?? ?}
?? ?

?? ?//登錄界面
?? ?
?? ?class dengLu extends JFrame implements ActionListener
?? ?{
?? ??? ?private JTextField zhangHao1;
?? ??? ?private JPasswordField password1;
?? ??? ?
?? ??? ?public dengLu
?? ??? ?()
?? ??? ?{
?? ??? ??? ?super();
?? ??? ??? ?
?? ??? ??? ?Box box=Box.createHorizontalBox();
?? ??? ??? ?zhangHao1=new JTextField(15);
?? ??? ??? ?box.add(new JLabel("賬號:"));
?? ??? ??? ?box.add(Box.createHorizontalStrut(10));
?? ??? ??? ?box.add(zhangHao1);
?? ??? ??? ?
?? ??? ??? ?Box box1=Box.createHorizontalBox();
?? ??? ??? ?password1=new JPasswordField(15);
?? ??? ??? ?box1.add(new JLabel("密碼:"));
?? ??? ??? ?box1.add(Box.createHorizontalStrut(10));
?? ??? ??? ?box1.add(password1);?
?? ??? ??? ?
?? ??? ??? ?
?? ??? ??? ?JButton button=new JButton("確認(rèn)");
?? ??? ??? ?button.addActionListener(this);
?? ??? ??? ?
?? ??? ??? ?Box box2=Box.createHorizontalBox();
?? ??? ??? ?box2.add(Box.createHorizontalStrut(30));
?? ??? ??? ?box2.add(button);

?? ??? ??? ?Box box3=Box.createVerticalBox();
?? ??? ??? ?box3.add(box);
?? ??? ??? ?box3.add(Box.createVerticalStrut(10));
?? ??? ??? ?box3.add(box1);
?? ??? ??? ?box3.add(Box.createVerticalStrut(10));
?? ??? ??? ?box3.add(box2);
?? ??? ??? ?
?? ??? ??? ?box3.setBounds(100,50,250,100);
?? ??? ??? ?
?? ??? ??? ?setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
?? ??? ??? ?setSize(500,250);
?? ??? ??? ?setLayout(null);
?? ??? ??? ?setVisible(true);
?? ??? ??? ?setLocation(700,300);
?? ??? ??? ?add(box3);
?? ??? ??? ?
?? ??? ?}

?? ??? ?@Override
?? ??? ?public void actionPerformed(ActionEvent e)?
?? ??? ?{
?? ??? ??? ?
?? ??? ??? ??? ?//需要插入一個檢驗數(shù)據(jù)合理性并更新數(shù)據(jù)庫的操作
?? ??? ??? ?String select=zhangHao1.getText();
?? ??? ??? ?String select1=new String(password1.getPassword());? ? ? //注意getPassword方法返回的時char數(shù)組
?? ??? ??? ?
?? ??? ??? ?select(select,select1);? ? ?//處理事件?
?? ??? ??? ?
?? ??? ?}
?? ??? ?
?? ??? ?
?? ??? ?private void select(String zh1,String pw1)
?? ??? ?{
?? ??? ??? ?try(
?? ??? ??? ?Statement statement1=jdbcConnection.getConnection().createStatement();
?? ??? ??? ?)
?? ??? ??? ?{
?? ??? ??? ??? ?String sqlsentence1="select * from person_information where ?賬號='"+zh1+"';";
?? ??? ??? ??? ?System.out.println(sqlsentence1);
?? ??? ??? ??? ?ResultSet set=statement1.executeQuery(sqlsentence1);
?? ??? ??? ??? ?
?? ??? ??? ??? ?
?? ??? ??? ??? ?if(!set.next())
?? ??? ??? ??? ?{
?? ??? ??? ??? ??? ?zhangHao1.setText("無此賬號!");? ? ? //查詢數(shù)據(jù)庫發(fā)現(xiàn)無此賬號記錄
?? ??? ??? ??? ?}
?? ??? ??? ??? ?else
?? ??? ??? ??? ??? ?if(set.getString("密碼").equals(pw1))
?? ??? ??? ??? ?{
?? ??? ??? ??? ??? ?new zhuYe(zh1,pw1);??//這里應(yīng)該新建一個賬號主頁
?? ??? ??? ??? ??? ?this.dispose();? ? //若輸入正確的賬號密碼,則次登錄窗口消失,進(jìn)入賬號主頁
?? ??? ??? ??? ? ? ?
?? ??? ??? ??? ?}
?? ??? ??? ??? ??? ?else
?? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ?zhangHao1.setText("密碼錯誤!"); ? ? ? ? ? ? ? ? ? //顯示密碼錯誤
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ?
?? ??? ??? ?}
?? ??? ??? ?catch(SQLException e)
?? ??? ??? ?{
?? ??? ??? ??? ?System.out.println("注冊賬號更新數(shù)據(jù)庫時出錯!");
?? ??? ??? ??? ?e.printStackTrace();
?? ??? ??? ??? ?System.exit(0);
?? ??? ??? ??? ?
?? ??? ??? ?}
?? ??? ?}
?? ??? ?
?? ??? ??? ??? ??? ??? ?
?? ?}?? ??? ??? ??? ?
}

主頁部分

主要思路:

主要包括三個按鈕對應(yīng)三個功能塊

package booksystem;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/*
?* 個人主頁
?*?
?*/

@SuppressWarnings("serial")
public class zhuYe extends JFrame?
{
?? ?static String zh;
?? ?static String pw;
?? ?
?? ?public zhuYe(String zh,String pw)
?? ?{
?? ??? ?super(zh+"的主頁");
?? ??? ?zhuYe.zh=zh;
?? ??? ?zhuYe.pw=pw;
?? ??? ?
?? ??? ?JButton button=new JButton("借書");
?? ??? ?button.setBounds(450,550,150,50);
?? ??? ?button.addActionListener(new ActionListener()
?? ??? ??? ??? ?{

?? ??? ??? ??? ??? ?@Override
?? ??? ??? ??? ??? ?public void actionPerformed(ActionEvent arg0) {
?? ??? ??? ??? ??? ??? ?new selectBook();
?? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ?});
?? ??? ?
?? ??? ?JButton button1=new JButton("還書");
?? ??? ?button1.setBounds(450,650,150,50);
?? ??? ?button1.addActionListener(new ActionListener()
?? ??? ??? ??? ?{

?? ??? ??? ??? ??? ?@Override
?? ??? ??? ??? ??? ?public void actionPerformed(ActionEvent arg0) {
?? ??? ??? ??? ??? ??? ?new returnBook();
?? ??? ??? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ??? ?});
?? ??? ?
?? ??? ?JButton button2=new JButton("查詢");
?? ??? ?button2.setBounds(450,750,150,50);
?? ??? ?button2.addActionListener(new ActionListener()
?? ??? ??? ??? ?{

?? ??? ??? ??? ??? ?@Override
?? ??? ??? ??? ??? ?public void actionPerformed(ActionEvent arg0)?
?? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ?new findNoReturnBook();
?? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ??? ?});
?? ??? ?
?? ??? ?add(button);
?? ??? ?add(button1);
?? ??? ?add(button2);
?? ??? ?
?? ??? ?setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
?? ??? ?setSize(1000,1000);
?? ??? ?setLocation(400,30);
?? ??? ?setLayout(null);
?? ??? ?setVisible(true);
?? ?}
?? ??? ??? ?
?? ?

}

借書部分

輸入關(guān)鍵詞,搜索數(shù)據(jù)庫的圖書列表,將相關(guān)的書籍顯示于列表框上,借閱天數(shù)默認(rèn)為10天。

package booksystem;

import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Vector;

import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

@SuppressWarnings("serial")
public class selectBook extends JFrame?
{
?? ?private JTextField textSelect;? ? ? //用戶輸入關(guān)鍵詞搜索的文本框
?? ?private JTextField textDay;? ? ? //用戶輸入借閱天數(shù)的文本框
?? ?private JList<String> list;? ? ? ?//顯示搜索結(jié)果的文本列表
?? ?private Vector<String> bookSelect; //根據(jù)關(guān)鍵字在數(shù)據(jù)庫中搜尋得到的書列表,作為JList的參數(shù)
?? ?private String bookName;? ?//在輸入關(guān)鍵字查詢列表中被選中的書名
?? ?private String borrowDay="10";? //借閱天數(shù)默認(rèn)為10天
?? ?
?? ?public selectBook()
?? ?{
?? ??? ?super();
?? ??? ?
?? ??? ?textSelect=new JTextField();
?? ??? ?textSelect.setPreferredSize(new Dimension(500,30));
?? ??? ?
?? ??? ?bookSelect=new Vector<String>();
?? ? ?
?? ??? ?JButton button=new JButton("搜索");? ? ?//搜索按鈕
?? ??? ?button.addActionListener(new ActionListener()
?? ??? ??? ??? ?{

?? ??? ??? ??? ??? ?@Override
?? ??? ??? ??? ??? ?public void actionPerformed(ActionEvent arg0) {
?? ??? ??? ??? ??? ??? ?String keyBookName=textSelect.getText().trim();? ?//獲取用戶輸入關(guān)鍵詞,然后對關(guān)鍵詞去除前后空格
?? ??? ??? ??? ??? ??? ?selectBookName(keyBookName); //調(diào)用函數(shù)
?? ??? ??? ??? ??? ??? ?list.setListData(bookSelect);? //添加搜索的數(shù)據(jù)
?? ??? ??? ??? ??? ??? ?list.repaint();? ? //重繪列表 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
?? ??? ??? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ??? ?});

?? ??? ?Box box=Box.createHorizontalBox();
?? ??? ?box.add(textSelect);
?? ??? ?box.add(Box.createHorizontalStrut(30));
?? ??? ?box.add(button);
?? ??? ?box.setBounds(180,100,600,30);
?? ?
?? ??? ?add(box);
?? ??? ?
?? ??? ?Font font=new Font("宋體",0,20);
?? ??? ?
?? ??? ?list=new JList<String>();? ? ?//顯示搜索得到的相關(guān)書籍
?? ??? ?list.setPreferredSize(new Dimension(200, 100));
?? ??? ?list.setFont(font);
?? ??? ?list.setListData(bookSelect);
?? ??? ?list.addListSelectionListener(new ListSelectionListener()
?? ??? ??? ??? ?{

?? ??? ??? ??? ??? ?@Override
?? ??? ??? ??? ??? ?public void valueChanged(ListSelectionEvent arg0)?
?? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ?bookName=list.getSelectedValue();? ?//bookName為用戶點擊可能借閱的書名
?? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ?
?? ??? ??? ??? ?});
?? ??? ?
?? ??? ?//添加滾動條
?? ??? ?JScrollPane scroll=new JScrollPane(list,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS ,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
?? ??? ?scroll.setBounds(100,150,800,500);
?? ??? ?
? ? ? ? add(scroll);
?? ??? ?
? ? ? ? JLabel label=new JLabel("天數(shù):");
? ? ? ? label.setBounds(350,650,100,50);
? ? ? ??
? ? ? ? add(label);
? ? ? ??
? ? ? ? textDay=new JTextField();
?? ??? ?textDay.setBounds(400,665,50,20);
?? ??? ?
?? ??? ?add(textDay);
?? ??? ?
?? ??? ?
?? ??? ?JButton button1=new JButton("借閱");
?? ??? ?button1.setBounds(380,700,70,35);
?? ??? ?button1.addActionListener(new ActionListener()
?? ??? ?
?? ??? ??? ??? ?{

?? ??? ??? ??? ??? ?@Override
?? ??? ??? ??? ??? ?public void actionPerformed(ActionEvent arg0) {
?? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ?if(bookName!=null)? ? ?//調(diào)用更新數(shù)據(jù)庫的信息
?? ??? ??? ??? ??? ??? ?{
? ? ? ? ? ? ? ? ? ? ? ? String tempt=textDay.getText(); //判斷用戶是否有輸入借閱天數(shù),沒有默認(rèn)為10天
?? ??? ??? ??? ??? ??? ??? ?if(!tempt.equals(""))
?? ??? ??? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ??? ??? ?borrowDay=tempt;
?? ??? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ??? ?System.out.println(tempt);
?? ??? ??? ??? ??? ??? ??? ?updateInformation();
?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?else
?? ??? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ??? ?System.out.println("還未確定借閱的書籍!");
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ??? ?});
?? ??? ?
?? ??? ?add(button1);
?? ??? ?
?? ??? ?setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
?? ??? ?setSize(1000,800);
?? ??? ?setLocation(400,200);
?? ??? ?setLayout(null);
?? ??? ?setVisible(true);
?? ??? ?
?? ?}

?? ?//連接數(shù)據(jù)庫
?? ?private void selectBookName(String name)
?? ?{
?? ??? ?String[] tempt=name.split(""); //對用戶輸入的關(guān)鍵字進(jìn)行簡單的除去空格處理
?? ??? ?name="%";
?? ??? ?
?? ??? ?for(int i=0;i<tempt.length;++i)? //將用戶輸入的關(guān)鍵詞做數(shù)據(jù)庫的模糊查詢處理
?? ??? ?{
?? ??? ??? ?if(!tempt[i].equals(" "))
?? ??? ??? ?{
?? ??? ??? ??? ?name=name+tempt[i]+"%";
?? ??? ??? ??? ?
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ?}
?? ??? ?
?? ??? ?try
?? ??? ?( Statement statement=jdbcConnection.getConnection().createStatement(); ) ? ? ? ? ? ? ? ? ?//連接數(shù)據(jù),搜索數(shù)據(jù)庫返回搜索結(jié)果
?? ??? ?{
?? ??? ??? ?String sql="select * from book_information where 書名 like '"+name+"';";
?? ??? ??? ?
?? ??? ??? ?ResultSet set=statement.executeQuery(sql);
?? ??? ??? ?
?? ??? ??? ?while(set.next())
?? ??? ??? ?{
?? ??? ??? ??? ?bookSelect.add(set.getString("書名"));
?? ??? ??? ??? ?
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ?for(int i=0;i<bookSelect.size();++i) //控制臺顯示模糊查詢的結(jié)果,優(yōu)化時可以作為文件儲存
?? ??? ??? ?{
?? ??? ??? ??? ?System.out.println(bookSelect.get(i));
?? ??? ??? ?}
?? ??? ?
?? ??? ??? ?
?? ??? ??? ?if(bookSelect==null)
?? ??? ??? ?{
?? ??? ??? ??? ?bookSelect.add("暫無該書籍!");
?? ??? ??? ??? ?
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ?
?? ??? ?}
?? ??? ?catch(SQLException e)
?? ??? ?{
?? ??? ??? ?System.out.println("根據(jù)關(guān)鍵字模糊查詢時出錯!");
?? ??? ??? ?e.printStackTrace();
?? ??? ??? ?System.exit(0);
?? ??? ?}
?? ??? ?
?? ??? ?
?? ?}
?? ?
?? ?//點擊借閱按鈕后更新數(shù)據(jù)庫的信息
?? ?/*
?? ? * 先將圖書館中對應(yīng)的書籍?dāng)?shù)量減一
?? ? * 再將借閱的記錄更新至個人的借閱未還記錄表中
?? ? */
?? ?private void updateInformation()
?? ?{
?? ??? ?try ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
?? ??? ?( Statement statement=jdbcConnection.getConnection().createStatement(); )
?? ??? ?{
?? ??? ??? ?String sql="select * from book_information where 書名='"+bookName+"';"; ? ? ? ? ? ? ? ??
?? ??? ??? ?ResultSet set=statement.executeQuery(sql);
?? ??? ??? ?
?? ??? ??? ?if(set.next()) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?//搜索不到這種書的信息,退出系統(tǒng)
?? ??? ??? ?{
?? ??? ??? ??? ?Integer number=set.getInt("數(shù)量")-1;
?? ??? ??? ??? ?String sql1="update book_information set 數(shù)量="+number+" ?where 書名='"+bookName+"';";
?? ??? ??? ??? ?statement.execute(sql1);
?? ??? ??? ??? ?System.out.println(sql1);
?? ??? ??? ??? ?
?? ??? ??? ?}
?? ??? ??? ?else
?? ??? ??? ?{
?? ??? ??? ??? ?System.out.println("沒有這種書的記錄!");
?? ??? ??? ??? ?System.exit(0);
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ?String sql2="insert into "+zhuYe.zh+zhuYe.pw+"_no_book_information ?values('"+bookName+"',now(),"+borrowDay+",now()+interval "+borrowDay+" day);";
?? ??? ??? ?System.out.println(sql2);
? ? ? ? ? ? statement.execute(sql2);
?? ??? ??? ?
?? ??? ??? ?
?? ??? ?}
?? ??? ?catch(SQLException e)
?? ??? ?{
?? ??? ??? ?System.out.println("借閱更新書籍時出錯!");
?? ??? ??? ?e.printStackTrace();
?? ??? ??? ?System.exit(0);
?? ??? ?}
?? ??? ?
?? ?}? ??

}

還書部分

自動查詢該賬戶未還書籍顯示在列表框中,可以點擊對應(yīng)書籍還書。

package booksystem;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Vector;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.ResultSet;
import javax.swing.*;
/*
?* 還書
?*?
?* 當(dāng)界面做好后,在還書時若沒有查詢到書本的信息說明書名輸入錯誤,這里直接退出程序,可以優(yōu)化為提示輸入錯誤并重新輸入書名
?*/
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
/*
?* 還書
?*?
?*/

@SuppressWarnings("serial")
public class returnBook ?extends JFrame
{
?? ?private String bookName;? ? ?//書名
?? ?private String borrowTime;? ? //借閱天數(shù)
?? ?private JList<String> list;? ? //未還書籍的列表
?? ?private Vector<String> bookSelect;? ? //未還書籍列表,作為JList的參數(shù)
?? ?
?? ?//窗口界面初始化
?? ?public returnBook()
?? ?{
?? ??? ?super();
?? ??? ?bookSelect=new Vector<String>();
?? ??? ?findBook(zhuYe.zh,zhuYe.pw);? ? ?//初始化bookSelect作為JList的內(nèi)容參數(shù)
?? ??? ?
? ? ? ? Font font=new Font("宋體",0,20);
?? ??? ?
?? ??? ?list=new JList<String>(); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
?? ??? ?list.setPreferredSize(new Dimension(200, 100));
?? ??? ?list.setListData(bookSelect);
?? ??? ?list.setFont(font);
?? ??? ?list.addListSelectionListener(new ListSelectionListener()
?? ??? ??? ??? ?{

?? ??? ??? ??? ??? ?@Override
?? ??? ??? ??? ??? ?public void valueChanged(ListSelectionEvent arg0)?
?? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ? String[] tempt=list.getSelectedValue().split(">>");? //將用戶選中的書名和借書時間分開存放
?? ??? ??? ??? ??? ??? ??
?? ??? ??? ??? ??? ??? ? if(tempt[0]!=null)? ?//判斷字符串處理是否有異常,有異常則退出程序
?? ??? ??? ??? ??? ??? ? {
?? ??? ??? ??? ??? ??? ? ? ?bookName=tempt[0];
?? ??? ??? ??? ??? ??? ? }
?? ??? ??? ??? ??? ??? ? else
?? ??? ??? ??? ??? ??? ? {
?? ??? ??? ??? ??? ??? ??? ? System.out.println("書名為空!");
?? ??? ??? ??? ??? ??? ??? ? System.exit(0);
?? ??? ??? ??? ??? ??? ? }
?? ??? ??? ??? ??? ??? ??
?? ??? ??? ??? ??? ??? ? if(tempt[1]!=null)
?? ??? ??? ??? ??? ??? ? {
?? ??? ??? ??? ??? ??? ? ? ?borrowTime=tempt[1];
?? ??? ??? ??? ??? ??? ? }
?? ??? ??? ??? ??? ??? ? else
?? ??? ??? ??? ??? ??? ? {
?? ??? ??? ??? ??? ??? ??? ? System.out.println("借書時間為空!");
?? ??? ??? ??? ??? ??? ??? ? System.exit(0);
?? ??? ??? ??? ??? ??? ? }
?? ??? ??? ??? ??? ??? ??
?? ??? ??? ??? ??? ??? ? System.out.println(bookName+borrowTime);
?? ??? ??? ??? ??? ??? ??
?? ??? ??? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ?
?? ??? ??? ??? ?});
?? ??? ?
?? ??? ?JScrollPane scroll=new JScrollPane(list,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS ,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
?? ??? ?scroll.setBounds(100,150,800,500);
?? ??? ?

?? ??? ?JButton button1=new JButton("歸還");? ?//點擊按鈕,歸還書籍
?? ??? ?button1.setBounds(400,670,70,35);
?? ??? ?button1.addActionListener(new ActionListener()
?? ??? ?
?? ??? ??? ??? ?{

?? ??? ??? ??? ??? ?@Override
?? ??? ??? ??? ??? ?public void actionPerformed(ActionEvent arg0) {
?? ??? ??? ??? ??? ??? ?if(bookName!=null) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
?? ??? ??? ??? ??? ??? ?updateNumber();
?? ??? ??? ??? ??? ??? ?//list.repaint();? ? ?//想要再歸還書籍后刷新頁面,不成功
?? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ??? ?});
? ? ? ??
? ? ? ? setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
? ? ? ? setSize(1000,800);
?? ??? ?setLocation(400,200);
?? ??? ?setLayout(null);
?? ??? ?setVisible(true);
?? ??? ?add(scroll);
?? ??? ?add(button1);
?? ??? ?
?? ?}
? ??
?? ?/*
?? ? * 在圖書館總圖書目錄中更新書籍的數(shù)量
?? ? * 然后在個人借閱未還記錄中刪除記錄,再在個人已還記錄中插入記錄
?? ? *?
?? ? */
?? ?
?? ?private void updateNumber()
?? ?{
?? ??? ?try(
?? ??? ?Statement statement=jdbcConnection.getConnection().createStatement();? ?//直接調(diào)用函數(shù)連接數(shù)據(jù)庫 ? ? ? ? ? ? ??? ?
?? ??? ??? ??? ?)
?? ??? ?{
?? ??? ??? ?String sql1="select * from book_information where 書名='"+bookName+"';";? ? //這里的數(shù)量和書名有待檢查修改
?? ??? ??? ?System.out.println(sql1);
?? ??? ??? ?ResultSet set=statement.executeQuery(sql1);
?? ??? ??? ?
?? ??? ??? ?if(set.next())? ?//搜索不到這種書的信息,退出系統(tǒng)
?? ??? ??? ?{
?? ??? ??? ??? ?Integer number=set.getInt("數(shù)量")+1;
?? ??? ??? ??? ?String sql2="update book_information set 數(shù)量="+number+" ?where 書名='"+bookName+"';";
?? ??? ??? ??? ?statement.execute(sql2);
?? ??? ??? ??? ?System.out.println(sql2);
?? ??? ??? ??? ?
?? ??? ??? ?}
?? ??? ??? ?else
?? ??? ??? ?{
?? ??? ??? ??? ?System.out.println("沒有這種書的記錄!");
?? ??? ??? ??? ?System.exit(0);
?? ??? ??? ?}
? ? ? ? ? ??
?? ??? ??? ?String sql="select * from "+zhuYe.zh+zhuYe.pw+"_no_book_information ?where 書名='"+bookName+"' and 借書時間='"+borrowTime+"';";
?? ??? ??? ?ResultSet set1=statement.executeQuery(sql);
?? ??? ??? ?
?? ??? ??? ?if(set1.next())
?? ??? ??? ?{
?? ??? ??? ?String sql3="insert into "+zhuYe.zh+zhuYe.pw+"_already_book_information values('"+set1.getString("書名")+"','"+set1.getString("借書時間")+"',"+set1.getString("借閱天數(shù)")+",'"+set1.getString("應(yīng)還時間")+"',"+"now());";
?? ??? ??? ?System.out.println(sql3);
?? ??? ??? ?statement.execute(sql3);
?? ??? ??? ?
?? ??? ??? ?String sql4="delete from "+zhuYe.zh+zhuYe.pw+"_no_book_information where 書名='"+bookName+"' and 借書時間='"+borrowTime+"';";
?? ??? ??? ?System.out.println(sql4);
?? ??? ??? ?statement.execute(sql4);
?? ??? ??? ?
?? ??? ??? ?}
?? ??? ??? ?else
?? ??? ??? ?{
?? ??? ??? ??? ?System.out.println(zhuYe.zh+"沒有這種書的借閱記錄!");
?? ??? ??? ??? ?System.exit(0);
?? ??? ??? ?}
?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ?
?? ??? ?}
?? ??? ?catch(SQLException g)
?? ??? ?{
?? ??? ??? ?System.out.println("更新數(shù)據(jù)時出錯!");
?? ??? ??? ?g.printStackTrace();
?? ??? ??? ?System.exit(0);
?? ??? ??? ?
?? ??? ?}
?? ??? ?
?? ?}
?? ?
?? ?private void findBook(String zh,String pw) //從數(shù)據(jù)庫中搜索表返回未歸還書名初始化bookSelect
?? ?{
?? ??? ?try
?? ??? ?( ?Statement statement1=jdbcConnection.getConnection().createStatement(); ? ? )
?? ??? ?{
?? ??? ??? ?String sql5="select * from "+zh+pw+"_no_book_information;";
?? ??? ??? ?ResultSet returnSet=statement1.executeQuery(sql5);
?? ??? ??? ?
?? ??? ??? ??? ?
?? ??? ??? ?while(returnSet.next())
?? ??? ??? ?{
?? ??? ??? ??? ?String name=returnSet.getString("書名")+">>"+returnSet.getString("借書時間"); ? ? ? ? ? ? ? ?//顯示書名和借書時間,這樣允許不同時間借同一本書
?? ??? ??? ??? ?
?? ??? ??? ??? ?bookSelect.add(name);
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ?if(bookSelect.size()==0)? ? ?//如果沒有借閱記錄
?? ??? ??? ?{
?? ??? ??? ??? ?bookSelect.add("暫無借閱記錄!");
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ?
?? ??? ?}
?? ??? ?catch(SQLException e)
?? ??? ?{
?? ??? ??? ?System.out.println("還書搜索未還書籍出錯!");
?? ??? ??? ?e.printStackTrace();
?? ??? ??? ?System.exit(0);
?? ??? ?}
?? ?}
??
}

查詢部分

查詢個人賬號的未還書籍具體信息,顯示在表格中。

package booksystem;
import java.awt.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Vector;
import javax.swing.*;

/*
?*?
?* 查詢還未歸還的書籍
?*/
@SuppressWarnings("serial")
public class findNoReturnBook extends JFrame ?
{

?? ?private Vector<Vector<String>> rowData;
?? ?
?? ?public findNoReturnBook()
?? ?{
?? ??? ?super();
?? ??? ?rowData=new Vector<Vector<String>>();
?? ??? ?Vector<String> columnNames=new Vector<String>();
?? ??? ?columnNames.add("書名");
?? ??? ?columnNames.add("借書時間");
?? ??? ?columnNames.add("借閱天數(shù)");
?? ??? ?columnNames.add("應(yīng)還時間");
?? ??? ?findBook(); ?//初始化rowData
?? ??? ?
?? ??? ?JTable table=new JTable(rowData,columnNames);
?? ??? ?JScrollPane pane=new JScrollPane(table);
?? ??? ?table.setPreferredScrollableViewportSize(new Dimension(400, 300));
?? ??? ?
?? ??? ?setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
?? ??? ?setSize(800,600);
?? ??? ?setLayout(new BorderLayout());
?? ??? ?add(pane,BorderLayout.CENTER);
?? ??? ?setLocation(500,200);
?? ??? ?setVisible(true);

?? ?}

?? ?private void findBook() ? ? ? //查詢數(shù)據(jù),并用容器收集起來
?? ?{
?? ??? ?try(
?? ??? ?Statement statement=jdbcConnection.getConnection().createStatement();
?? ??? ?)
?? ??? ?{
?? ??? ??? ?String sql="select * from "+zhuYe.zh+zhuYe.pw+"_no_book_information;";
?? ??? ??? ?ResultSet result=statement.executeQuery(sql);
?? ??? ??? ?
?? ??? ??? ?while(result.next())
?? ??? ??? ?{
?? ??? ??? ??? ?Vector<String> tempt=new Vector<String>();
?? ??? ??? ??? ?tempt.add(result.getString("書名"));
?? ??? ??? ??? ?tempt.add(result.getString("借書時間"));
?? ??? ??? ??? ?tempt.add(result.getString("借閱天數(shù)"));
?? ??? ??? ??? ?tempt.add(result.getString("應(yīng)還時間"));
?? ??? ??? ??? ?
?? ??? ??? ??? ?if(tempt!=null)
?? ??? ??? ??? ?rowData.add(tempt);
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ?if(rowData==null)
?? ??? ??? ?{
?? ??? ??? ??? ?Vector<String> tempt=new Vector<String>();
?? ??? ??? ??? ?tempt.add("暫無借閱數(shù)據(jù)");
?? ??? ??? ??? ?rowData.add(tempt);
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ?
?? ??? ?}
?? ??? ?catch(SQLException |NullPointerException a)
?? ??? ?{
?? ??? ??? ?System.out.println("查詢數(shù)據(jù)出錯!");
?? ??? ??? ?a.printStackTrace();
?? ??? ??? ?System.exit(0);
?? ??? ??? ?
?? ??? ?}
?? ?}
?? ?

}

總結(jié):

1).swing的界面設(shè)計很不熟練。(個人也覺得用這個工具包設(shè)計界面很是麻煩)
2).做項目的過程將界面和功能的實現(xiàn)混在一起,不利于后期的修改。

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Java類中this關(guān)鍵字與static關(guān)鍵字的用法解析

    Java類中this關(guān)鍵字與static關(guān)鍵字的用法解析

    這篇文章主要介紹了Java類中this關(guān)鍵字與static關(guān)鍵字的用法解析,文章圍繞主題展開詳細(xì)的內(nèi)容介紹,具有一定的參考價值,需要的小伙伴可以參考一下
    2022-09-09
  • Spring Boot 通過 Mvc 擴(kuò)展方便進(jìn)行貨幣單位轉(zhuǎn)換的代碼詳解

    Spring Boot 通過 Mvc 擴(kuò)展方便進(jìn)行貨幣單位轉(zhuǎn)換的代碼詳解

    這篇文章主要介紹了Spring Boot 通過 Mvc 擴(kuò)展方便進(jìn)行貨幣單位轉(zhuǎn)換,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2020-12-12
  • java 網(wǎng)絡(luò)編程之TCP通信和簡單的文件上傳功能實例

    java 網(wǎng)絡(luò)編程之TCP通信和簡單的文件上傳功能實例

    下面小編就為大家分享一篇java 網(wǎng)絡(luò)編程之TCP通信和簡單的文件上傳功能實例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-01-01
  • 詳解在Spring Boot中使用Mysql和JPA

    詳解在Spring Boot中使用Mysql和JPA

    本文向你展示如何在Spring Boot的Web應(yīng)用中使用Mysq數(shù)據(jù)庫,也充分展示Spring Boot的優(yōu)勢
    2017-04-04
  • java實現(xiàn)多人聊天工具(socket+多線程)

    java實現(xiàn)多人聊天工具(socket+多線程)

    這篇文章主要為大家詳細(xì)介紹了java實現(xiàn)多人聊天工具,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2021-08-08
  • springboot整合logback實現(xiàn)日志管理操作

    springboot整合logback實現(xiàn)日志管理操作

    本章節(jié)是記錄logback在springboot項目中的簡單使用,本文將會演示如何通過logback將日志記錄到日志文件或輸出到控制臺等管理操作,感興趣的朋友跟隨小編一起看看吧
    2024-02-02
  • Java實現(xiàn)單鏈表SingleLinkedList增刪改查及反轉(zhuǎn) 逆序等

    Java實現(xiàn)單鏈表SingleLinkedList增刪改查及反轉(zhuǎn) 逆序等

    單鏈表是鏈表的其中一種基本結(jié)構(gòu)。一個最簡單的結(jié)點結(jié)構(gòu)如圖所示,它是構(gòu)成單鏈表的基本結(jié)點結(jié)構(gòu)。在結(jié)點中數(shù)據(jù)域用來存儲數(shù)據(jù)元素,指針域用于指向下一個具有相同結(jié)構(gòu)的結(jié)點。 因為只有一個指針結(jié)點,稱為單鏈表
    2021-10-10
  • Java實現(xiàn)猜數(shù)程序

    Java實現(xiàn)猜數(shù)程序

    這篇文章主要為大家詳細(xì)介紹了Java實現(xiàn)猜數(shù)程序,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2020-12-12
  • SpringBoot整合ActiveMQ的詳細(xì)步驟

    SpringBoot整合ActiveMQ的詳細(xì)步驟

    昨天仔細(xì)研究了activeMQ消息隊列,也遇到了些坑,下面這篇文章主要給大家介紹了關(guān)于SpringBoot整合ActiveMQ的相關(guān)資料,文中通過實例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2022-11-11
  • java獲取中文拼音首字母的實例

    java獲取中文拼音首字母的實例

    下面小編就為大家?guī)硪黄猨ava獲取中文拼音首字母的實例。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-09-09

最新評論