看看男人日女人,亚洲欧美日韩日本国产三,国产精品欧美日韩区二区,妓女影库妓女网在线视频

java圖書管理系統(tǒng)項目代碼

Java圖書管理系統(tǒng)項目代碼

Java圖書管理系統(tǒng)是一種功能強大的圖書館應(yīng)用程序,可以幫助圖書館管理員管理圖書,包括添加,刪除,修改和查找圖書。本文章將介紹一個基本的Java圖書管理系統(tǒng)項目代碼,包括用戶界面和圖書館管理功能。

首先,我們需要創(chuàng)建一個Java應(yīng)用程序項目,可以使用Java Swing框架來創(chuàng)建用戶界面。以下是一個簡單的代碼示例:

“`java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class BookManager extends JPanel implements ActionListener {
private JTable booksTable;
private JTable authorTable;
private JTable subjectTable;
private JTable titleTable;
private JTable descriptionTable;
private int[][] data = new int[10][10];
private int[][] indexes = new int[10][10];
private int[] authorIds = new int[10];
private int[] subjectIds = new int[10];
private int[] titleIds = new int[10];
private int[] descriptionIds = new int[10];

public BookManager() {
booksTable = new JTable(data);
authorTable = new JTable(authorIds);
subjectTable = new JTable(subjectIds);
titleTable = new JTable(titleIds);
descriptionTable = new JTable(descriptionIds);
JPanel authorPanel = new JPanel();
authorPanel.setLayout(new GridLayout(3, 2));
authorTable.setRowHeaderColor(Color.BLACK);
authorPanel.add(authorTable.getRowHeader());
JPanel subjectPanel = new JPanel();
subjectPanel.setLayout(new GridLayout(3, 2));
subjectTable.setRowHeaderColor(Color.BLACK);
subjectPanel.add(subjectTable.getRowHeader());
JPanel titlePanel = new JPanel();
titlePanel.setLayout(new GridLayout(3, 2));
titleTable.setRowHeaderColor(Color.BLACK);
titlePanel.add(titleTable.getRowHeader());
JPanel descriptionPanel = new JPanel();
descriptionPanel.setLayout(new GridLayout(3, 2));
descriptionTable.setRowHeaderColor(Color.BLACK);
descriptionPanel.add(descriptionTable.getRowHeader());
JPanel bookPanel = new JPanel();
bookPanel.setLayout(new GridLayout(3, 2));
booksTable.add(bookPanel);
bookPanel.setLayout(new BorderLayout());
bookPanel.add(authorPanel, BorderLayout.NORTH);
bookPanel.add(subjectPanel, BorderLayout.CENTER);
bookPanel.add(titlePanel, BorderLayout.SOUTH);
bookPanel.setLayout(new BorderLayout());
bookPanel.add(descriptionPanel, BorderLayout.CENTER);
bookPanel.setLayout(new BorderLayout());
bookPanel.add(data, BorderLayout.CENTER);
add(bookPanel);
}

@Override
public void actionPerformed(ActionEvent e) {
int authorId = (int) e.getItem().getItemValue();
if (authorId == 1) {
authorTable.setRowHeader(authorPanel.getComponent());
} else if (authorId == 2) {
authorTable.setRowHeaderColor(Color.WHITE);
authorPanel.remove(authorTable.getRowHeader());
} else if (authorId == 3) {
authorTable.setRowHeader(null);
authorPanel.remove(authorTable.getRowHeader());
} else if (authorId == 4) {
authorTable.setRowHeaderColor(Color.BLACK);
authorPanel.remove(authorTable.getRowHeader());
} else if (authorId == 5) {
authorTable.setRowHeader(null);
authorPanel.remove(authorTable.getRowHeader());
} else if (authorId == 6) {
authorTable.setRowHeader(titlePanel.getComponent());
titlePanel.revalidate();
titlePanel.repaint();
} else if (authorId == 7) {
authorTable.setRowHeader(null);
titlePanel.revalidate();
titlePanel.repaint();
} else if (authorId == 8) {
authorTable.setRowHeader(descriptionPanel.getComponent());
descriptionPanel.revalidate();
descriptionPanel.repaint();
} else if (authorId == 9) {
authorTable.setRowHeader(null);
descriptionPanel.revalidate();
descriptionPanel.repaint();
} else if (authorId == 10) {
authorTable.setRowHeader(null);
titlePanel.revalidate();
titlePanel.repaint();
} else if (authorId == 11) {
authorTable.setRowHeader(null);
descriptionPanel.revalidate();
descriptionPanel.repaint();
} else if (authorId == 12) {
authorTable.setRowHeader(null);
titlePanel.revalidate();
titlePanel.repaint();
} else if (authorId == 13) {
authorTable.setRowHeader(null);
descriptionPanel.revalidate();
descriptionPanel.repaint();
} else if (authorId == 14) {
authorTable.setRowHeader(null);
titlePanel.revalidate();
titlePanel.repaint();
} else if (authorId == 15) {
authorTable.setRowHeader(null);
descriptionPanel.revalidate();
descriptionPanel.repaint();
} else if (authorId == 16) {
authorTable.setRowHeader(null);
titlePanel.revalidate();
titlePanel.repaint();
} else if (authorId == 17) {
authorTable.setRowHeader(null);
descriptionPanel.revalidate();
descriptionPanel.repaint();
} else if (authorId == 18) {
authorTable.setRowHeader(null);
titlePanel.revalidate();
titlePanel.repaint();
} else if (authorId == 19) {
authorTable.setRowHeader(null);
descriptionPanel.revalidate();
descriptionPanel.repaint();
} else if (authorId == 20) {
authorTable.setRowHeader(null);
titlePanel.revalidate();
titlePanel.repaint();
} else if (authorId == 21) {
authorTable.setRowHeader(null);
descriptionPanel.revalidate();
descriptionPanel.repaint();
} else if (authorId == 22) {
authorTable.setRowHeader(null);
titlePanel.revalidate();
titlePanel.repaint();
} else if (authorId == 23) {
authorTable.setRowHeader(null);
descriptionPanel.revalidate();
descriptionPanel.repaint();
} else if (authorId == 24) {
authorTable.setRowHeader(null);
titlePanel.revalidate();
titlePanel.repaint();
} else if (authorId == 25) {
authorTable.setRowHeader(null);
descriptionPanel.revalidate();
descriptionPanel.repaint();
} else if (authorId == 26) {
authorTable.setRowHeader(null);
titlePanel.revalidate();
titlePanel.repaint();
} else if (authorId == 27) {
authorTable.setRowHeader(null);
descriptionPanel.revalidate();
descriptionPanel.repaint();
} else if (authorId == 28) {
authorTable.setRowHeader(null);
titlePanel.revalidate();
titlePanel.repaint();
} else if (authorId == 29) {
authorTable

相關(guān)新聞

聯(lián)系我們
聯(lián)系我們
在線咨詢
分享本頁
返回頂部
宝丰县| 土默特右旗| 新宾| 长垣县| 百色市| 武胜县| 平远县| 荥阳市| 普陀区| 行唐县| 乌恰县| 安义县| 永清县| 宜昌市| 临猗县| 洛川县| 乐平市| 丹巴县| 呼伦贝尔市| 贵阳市| 高碑店市| 宣恩县| 泾川县| 尼勒克县| 新沂市| 富裕县| 周口市| 洞头县| 沛县| 佳木斯市| 通辽市| 柞水县| 桃江县| 虎林市| 藁城市| 万州区| 漠河县| 稷山县| 宣城市| 吉木萨尔县| 南城县|