導航:首頁 > 編程語言 > 圖書管理系統源代碼java

圖書管理系統源代碼java

發布時間:2022-05-08 20:57:12

『壹』 用java做一個簡單的圖書管理系統不用資料庫

可以利用文件的輸入、輸出,再利用list或set集合,進行數據的輸入、輸出,完全可以做到。
但是如果不用資料庫的話,可能比較麻煩一點,代碼寫的肯定比較多了,當然還會有很多問題,
所以我建議你還是使用資料庫,會減少很多事的

『貳』 圖書信息管理系統(java代碼)

忽忽~~ 我有~~ 還需要麼?

『叄』 求java圖書管理系統源代碼

這個源碼,我可以發你

『肆』 急急急……Java課程設計:圖書管理系統的開發源代碼 要求原創 謝了

你有點懶哦

『伍』 java圖書管理界面系統的源代碼

javaswing登陸界面code
/*
* Login.java
*
* Created on __DATE__, __TIME__
*/

package com.agen.library.window;

import java.awt.Image;
import java.awt.Toolkit;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.;

import com.agen.library.factory.DAOFactory;
import com.agen.library.util.GlobalUser;
import com.agen.library.vo.User;

/**
*
* @author __USER__
*/
public class Login extends javax.swing.JFrame {

/**
*
*/
private static final long serialVersionUID = -2176093732040600809L;
/** Creates new form Login */
public Login() {
super("易雲圖書管理軟體V1.0");
Image ime = Toolkit.getDefaultToolkit().getImage(
getClass().getResource("/images/ico.png"));
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch ( e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
setIconImage(ime);
initComponents();
setLocationRelativeTo(null);
this.setResizable(false);

}

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
// GEN-BEGIN:initComponents
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jPasswordField1 = new javax.swing.JPasswordField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jMenuItem2 = new javax.swing.JMenuItem();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
formKeyPressed(evt);
}

public void keyTyped(java.awt.event.KeyEvent evt) {
formKeyTyped(evt);
}
});

jLabel2.setFont(new java.awt.Font("微軟雅黑", 0, 14));
jLabel2.setText("\u7528\u6237\u540d\uff1a");

jLabel3.setFont(new java.awt.Font("微軟雅黑", 0, 14));
jLabel3.setText("\u5bc6 \u7801\uff1a");

jTextField1.setFont(new java.awt.Font("微軟雅黑", 0, 14));
jTextField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField1ActionPerformed(evt);
}
});

jPasswordField1.setFont(new java.awt.Font("微軟雅黑", 0, 12));
jPasswordField1.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
jPasswordField1KeyTyped(evt);
}
});

jButton1.setBackground(new java.awt.Color(223, 216, 216));
jButton1.setFont(new java.awt.Font("微軟雅黑", 0, 14));
jButton1.setText("\u767b\u9646");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

jButton2.setBackground(new java.awt.Color(223, 216, 216));
jButton2.setFont(new java.awt.Font("微軟雅黑", 0, 14));
jButton2.setText("\u53d6\u6d88");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

jLabel1.setIcon(new javax.swing.ImageIcon(
getClass().getResource("/images/login_main.jpg"))); // NOI18N

jMenu1.setText("File");
jMenu1.setFont(new java.awt.Font("微軟雅黑", 0, 14));

jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
java.awt.event.KeyEvent.VK_Q,
java.awt.event.InputEvent.CTRL_MASK));
jMenuItem1.setText("Exit");
jMenuItem1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jMenuItem1MouseClicked(evt);
}
});
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem1);

jMenuBar1.add(jMenu1);

jMenu2.setText("Help");
jMenu2.setFont(new java.awt.Font("微軟雅黑", 0, 14));

jMenuItem2.setText("About");
jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem2ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem2);

jMenuBar1.add(jMenu2);

setJMenuBar(jMenuBar1);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(layout
.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addGroup(
layout.createSequentialGroup()
.addContainerGap()
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.TRAILING,
false)
.addComponent(
jLabel2,
javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(
javax.swing.GroupLayout.Alignment.LEADING,
layout.createSequentialGroup()
.addComponent(
jLabel3)
.addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(
layout.createSequentialGroup()
.addGap(10,
10,
10)
.addComponent(
jButton1)
.addGap(47,
47,
47)
.addComponent(
jButton2))
.addComponent(
jPasswordField1)
.addComponent(
jTextField1,
javax.swing.GroupLayout.DEFAULT_SIZE,
197,
Short.MAX_VALUE))
.addContainerGap()))));
layout.setVerticalGroup(layout
.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(
layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(
jTextField1,
javax.swing.GroupLayout.PREFERRED_SIZE,
24,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(
jPasswordField1,
javax.swing.GroupLayout.PREFERRED_SIZE,
23,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton2))
.addContainerGap(
javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)));

pack();
}// </editor-fold>
// GEN-END:initComponents

private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:
About.start();
}

private void jPasswordField1KeyTyped(java.awt.event.KeyEvent evt) {
if (evt.getKeyChar() == '\n') {
String name = jTextField1.getText(); // 獲取用戶名
String pass = String.valueOf(jPasswordField1.getPassword());// 獲取密碼
User user = null;

// 未輸入用戶名
if (name.equals("") || name == null) {
JOptionPane.showMessageDialog(this, "用戶名不允許為空!", "cuowu", 0);
return;
}
try {
user = DAOFactory.getIUserDAOInstance().findById(name);
if (user != null) {
if (user.getPass() != null && user.getPass().equals(pass)) {

GlobalUser.LOGIN_USER = user; // 記錄當前用戶

// 進入主界面
Main.start();
this.dispose();
} else {
JOptionPane.showMessageDialog(this, "用戶名或密碼錯誤!");
return;
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (user == null) {
JOptionPane.showMessageDialog(this, "用戶名或密碼錯誤!", "消息", 0);
return;
}

}

}

private void formKeyTyped(java.awt.event.KeyEvent evt) {

}

private void formKeyPressed(java.awt.event.KeyEvent evt) {

}

private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
jTextField1.setText("");
jPasswordField1.setText("");
jTextField1.requestFocus();

}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String name = jTextField1.getText(); // 獲取用戶名
String pass = String.valueOf(jPasswordField1.getPassword());// 獲取密碼
User user = null;

// 未輸入用戶名
if (name.equals("")) {
JOptionPane.showMessageDialog(this, "用戶名不允許為空!");
return;
}
try {
user = DAOFactory.getIUserDAOInstance().findById(name);
if (user != null) {
if (user.getPass() != null && user.getPass().equals(pass)) {

GlobalUser.LOGIN_USER = user; // 記錄當前用戶

// 進入主界面
Main.start();
this.dispose();
} else {
JOptionPane.showMessageDialog(this, "用戶名或密碼錯誤!", "消息", 0);
return;
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (user == null) {
JOptionPane.showMessageDialog(this, "用戶名或密碼錯誤!", "消息", 0);
return;
}

}

private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
if (JOptionPane.showConfirmDialog(this, "你確定要退出嗎?", "提示",
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
System.exit(0);
}
}

private void jMenuItem1MouseClicked(java.awt.event.MouseEvent evt) {
System.exit(1);
}

/**
* @param args
* the command line arguments
*/
public static void main(String args[]) {
// System.out.println(Login.class.getResource("src/images/images/login_main.jpg"));
// new javax.swing.ImageIcon(
// Login.class.getResource("../../../../images/login_main.jpg"));
// new Login().setVisible(true);
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Login().setVisible(true);
}
});
}

// GEN-BEGIN:variables
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JPasswordField jPasswordField1;
private javax.swing.JTextField jTextField1;
// End of variables declaration//GEN-END:variables

}

『陸』 求圖書借閱管理系統的java源代碼

基於Java的圖書管理系統 沒問題 看我的資料

『柒』 求一個java圖書管理系統代碼,不需要圖形化,命令行就可以,只要求實現導入圖書,查詢,刪除

importjava.io.BufferedReader;
importjava.io.File;
importjava.io.FileReader;
importjava.util.ArrayList;
importjava.util.List;
importjava.util.Scanner;

publicclassBookWork{

staticList<Book>data;
privatestaticScannerinput;

publicstaticvoidmain(String[]args){
if(!initBook("d:/book.txt")){
System.out.println("初始圖書列表失敗..");
return;
}
input=newScanner(System.in);
while(true){
try{
System.out.println("請輸入操作:");
System.out.println("1.找書2.刪除圖書3.退出");
intnumber=Integer.parseInt(input.next());
if(number==1){
findBook();
}elseif(number==2){
delBook();
}elseif(number==3){
System.out.println("退出");
break;
}else{
System.out.println("這個不是我要的...重來...");
System.out.println();
}

}catch(Exceptione){
e.printStackTrace();
System.out.println("這個不是我要的...重來...");
System.out.println();
}
}
}

privatestaticvoiddelBook(){
System.out.println("請輸入要刪除的書名或編號:");
Stringkey=input.next();
if(key!=null&&!key.equals("")){

for(Bookbook:data){
if(book.number.equals(key)||book.name.contains(key)){
data.remove(book);
System.out.println("圖書"+book.toString()+"已刪除");
return;
}
}
}
System.out.println("沒有您要刪除的");

}

privatestaticvoidfindBook(){
System.out.println("請輸入要查找的書名或編號:");
Stringkey=input.next();
if(key!=null&&!key.equals("")){

for(Bookbook:data){
if(book.number.equals(key)||book.name.contains(key)){
System.out.println("找到了圖書"+book.toString());
return;
}
}
}
System.out.println("沒有您要找的");
}

privatestaticbooleaninitBook(Stringstring){
try{
System.out.println("圖書導入中...");
System.out.println("列表文件--"+string);

Filefile=newFile(string);
if(!file.exists()){
returnfalse;
}
data=newArrayList<Book>();
BufferedReaderbufferedReader=newBufferedReader(newFileReader(file));
Stringline="";
while((line=bufferedReader.readLine())!=null){
String[]strings=line.split(",");
Bookb=newBook(strings[0],strings[1]);
data.add(b);
System.out.println("導入"+b.toString());
}
}catch(Exceptione){
e.printStackTrace();
returnfalse;
}
returntrue;
}

publicstaticclassBook{
Stringnumber;
Stringname;

publicBook(Stringnumber,Stringname){
super();
this.number=number;
this.name=name;
}

@Override
publicStringtoString(){
return"Book[編碼:"+number+",名稱:"+name+"]";
}
}
}

001,金瓶梅

002,雜事秘辛

003,飛燕外傳

004,控鶴監秘記

005,漢宮春色

『捌』 使用java編寫一份圖書管理系統(急!!!!)

首先建立一個book類在model包下的book.Java文件中,接著是主文件,在UI包下的MainClass.java文件,然後編寫代碼,不會的找專業書籍學習下,不難的 純手打!望採納!

『玖』 圖書管理系統怎麼用java代碼實現具體步驟

1
業務需求,風險分析

2
分析資料庫關系

3
搭項目框架

4
書寫代碼

5
測試項目

6
提交項目

閱讀全文

與圖書管理系統源代碼java相關的資料

熱點內容
天正建築批量刪除命令 瀏覽:94
cad最下面的一排命令都什麼意思 瀏覽:456
pythonimportcpp 瀏覽:850
W10的系統怎麼給U盤加密 瀏覽:370
華為手機代碼編程教學入門 瀏覽:762
和彩雲沒會員怎樣解壓 瀏覽:634
androidimageview保存 瀏覽:387
新買店鋪什麼伺服器 瀏覽:883
文件夾能直接刻錄嗎 瀏覽:493
androidxmpp刪除好友 瀏覽:969
javac哪個前景好 瀏覽:427
中華英才網app為什麼不能搜索了 瀏覽:660
伺服器域名是什麼意思 瀏覽:52
Linux導出mysql命令 瀏覽:159
無詐建鄴是什麼app 瀏覽:228
python中的雙色球 瀏覽:167
python解釋器里如何換行 瀏覽:412
python編寫格式 瀏覽:576
用python做出來的軟體 瀏覽:469
伺服器指示燈代表什麼 瀏覽:702