package com.Library.UI;
import javax.swing.*;
import com.Library.DataBase.DataBase;
import com.Library.Service.*;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.*;
import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;
/**
* 图书管理系统 2.0 Mysql 数据库版
* 管理员类
* @author PuaChen
*
*/
public class ManagementWindow extends JFrame {
private static final long serialVersionUID = 6918457427019512011L;
private JPanel imagePanel;
private ImageIcon background;
private JPanel pane = null; // 主要的JPanel
private CardLayout card = null; // CardLayout布局管理器
private JPanel p_1 = null, p_2 = null, p_3 = null, p_4 = null, p_5 = null, p_6 = null, p_7 = null
, p_8 = null, p_9 = null, p_10 = null,P_main=null;
private String CheckSex="男";//注册普通用户使用的性别判断的功能标识符
private Vector<Serializable> rowData,columnNames; //rowData用来存放行数据 , columnNames存放列名
private int Mark;//作为表格选择功能的标记位
private String data;//作为表格查看的数据 传递的参数
private ResultSet rstable=null;//作为表格的查看数据库调用的方法
private JPanel P_table=null;
private Icon ico=new ImageIcon("images/button.png");//设置按钮的背景颜色
/* public static void main(String[] args) {//单独测试用的main
new ManagementWindow();
}*/
/**
* 构造方法
*/
public ManagementWindow() {
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e) {
DataBase.Colse();//关闭数据库连接
System.exit(0);
}
});
setTitle("Library图书馆 Admin(V2.0)");
setBounds(100, 100, 1205, 830);
setLocationRelativeTo(null);//让窗口居中显示
setResizable(false);//禁用窗口最大化按钮
setImg();//加载图片
CardPanle();//卡片布局加载
Label(); // 标签上方组件
ButtonSet();// 加载功能按钮
P_main.setBackground(Color.gray);
setVisible(true);
}
/**
* 注册卡片布局框架
*/
public void CardPanle(){
card = new CardLayout(5, 5);
pane = new JPanel(card); // JPanel的布局管理将被设置成CardLayout
pane.setBounds(228, 120, 957, 662);
getContentPane().add(pane);
P_main= new JPanel();
p_1 = new JPanel();
p_2 = new JPanel();
p_3 = new JPanel();
p_4 = new JPanel();
p_5 = new JPanel();
p_6 = new JPanel();
p_7 = new JPanel();
p_8 = new JPanel();
p_9 = new JPanel();
p_10 = new JPanel();
P_main.setLayout(null);
p_1.setLayout(null);
p_2.setLayout(null);
p_3.setLayout(null);
p_4.setLayout(null);
p_5.setLayout(null);
p_6.setLayout(null);
p_7.setLayout(null);
p_8.setLayout(null);
p_9.setLayout(null);
p_10.setLayout(null);
ClickEvent_Adminadd();//添加管理员窗体
ClickEvent_AdminDelect();//删除管理员窗体
ClickEvent_UserAdd();//添加用户窗体
ClickEvent_UserUpdata();//更新用户窗体
ClickEvent_UserDelect();//删除用户窗体
ClickEvent_UserQuery();//查找用户窗体
ClickEvent_BookAddAndUpdata();//添加或更新图书窗体
ClickEvent_BookBorrowQueryByID();//查找用户借了那些书的图书窗体
ClickEvent_QueryBooks();//查询图书图书窗体
ClickEvent_DelectBook();//删除图书图书窗体
SetP_Main_Img();
pane.add(P_main, "P_main"); //讲窗体标签添加到界面上
pane.add(p_1, "p1");
pane.add(p_2, "p2");
pane.add(p_3, "p3");
pane.add(p_4, "p4");
pane.add(p_5, "p5");
pane.add(p_6, "p6");
pane.add(p_7, "p7");
pane.add(p_8, "p8");
pane.add(p_9, "p9");
pane.add(p_10, "p10");
}
/**
* 功能按钮组件
*/
public void ButtonSet(){
JButton BtnAdmin_add = new JButton("新增管理员",ico);
BtnAdmin_add.setForeground(Color.WHITE);
BtnAdmin_add.setHorizontalTextPosition(SwingConstants.CENTER);
BtnAdmin_add.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { //添加管理员的点击事件
card.show(pane, "p1");
}
});
BtnAdmin_add.setBounds(8, 164, 190, 27);
getContentPane().add(BtnAdmin_add);
JButton BtnAdmin_delect = new JButton("删除管理员",ico);//间隙+10
BtnAdmin_delect.setForeground(Color.WHITE);
BtnAdmin_delect.setHorizontalTextPosition(SwingConstants.CENTER);
BtnAdmin_delect.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { //删除点击
card.show(pane, "p2");
}
});
BtnAdmin_delect.setBounds(8, 201, 190, 27);
getContentPane().add(BtnAdmin_delect);
JButton BtnUser_add = new JButton("添加用户",ico);
BtnUser_add.setForeground(Color.WHITE);
BtnUser_add.setHorizontalTextPosition(SwingConstants.CENTER);
BtnUser_add.addActionListener(new ActionListener() { //添加一个普通用户
public void actionPerformed(ActionEvent e) {
card.show(pane, "p3");
}
});
BtnUser_add.setBounds(8, 238, 190, 27);
getContentPane().add(BtnUser_add);
JButton BtnUser_updata = new JButton("更新用户",ico);
BtnUser_updata.setForeground(Color.WHITE);
BtnUser_updata.setHorizontalTextPosition(SwingConstants.CENTER);
BtnUser_updata.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { //更新用户信息
card.show(pane, "p4");
}
});
BtnUser_updata.setBounds(8, 275, 190, 27);
getContentPane().add(BtnUser_updata);
JButton BtnUser_delect = new JButton("删除用户",ico);
BtnUser_delect.setForeground(Color.WHITE);
BtnUser_delect.setHorizontalTextPosition(SwingConstants.CENTER);
BtnUser_delect.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { //删除用户
card.show(pane, "p5");
}
});
BtnUser_delect.setBounds(8, 312, 190, 27);
getContentPane().add(BtnUser_delect);
JButton BtnUser_query = new JButton("查找用户",ico);
BtnUser_query.setForeground(Color.WHITE);
BtnUser_query.setHorizontalTextPosition(SwingConstants.CENTER);
BtnUser_query.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { //查找普通用户的信息
card.show(pane, "p6");
}
});
BtnUser_query.setBounds(8, 349, 190, 27);
getContentPane().add(BtnUser_query);
JButton BtnBook_add = new JButton("添加或更新图书",ico);
BtnBook_add.setForeground(Color.WHITE);
BtnBook_add.setHorizontalTextPosition(SwingConstants.CENTER);
BtnBook_add.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { //添加图书
card.show(pane, "p7");
}
});
BtnBook_add.setBounds(8, 406, 190, 27);
getContentPane().add(BtnBook_add);
JButton BtnBook_UserFindsBook = new JButton("查找用户借书信息",ico);
BtnBook_UserFindsBook.setForeground(Color.WHITE);
BtnBook_UserFindsBook.setHorizontalTextPosition(SwingConstants.CENTER);
BtnBook_UserFindsBook.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { //查看用户借了那些书
card.show(pane, "p8");
}
});
BtnBook_UserFindsBook.setBounds(8, 443, 190, 27);
getContentPane().add(BtnBook_UserFindsBook);
JButton BtnBook_delect = new JButton("删除图书",ico);
BtnBook_delect.setForeground(Color.WHITE);
BtnBook_delect.setHorizontalTextPosition(SwingConstants.CENTER);
BtnBook_delect.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { //删除图书
card.show(pane, "p9");
}
});
BtnBook_delect.setBounds(8, 480, 190, 27);
getContentPane().add(Bt
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
基于java的图书管理系统 (108个子文件)
ManagementWindow.class 21KB
Library.class 17KB
UserDao.class 6KB
LoginWindow.class 4KB
BookDao.class 4KB
Library$QueryBookTable.class 4KB
UserServise.class 3KB
ManagementWindow$27.class 3KB
ManagementWindow$29.class 3KB
BorrowAndReturnDao.class 3KB
Library$15.class 2KB
BookServise.class 2KB
ManagementWindow$22.class 2KB
Library$QueryBookTable$3.class 2KB
ManagementWindow$19.class 2KB
Library$12.class 2KB
Library$8.class 2KB
Library$4.class 2KB
Library$3.class 2KB
Library$2.class 2KB
Library$5.class 2KB
AdminDao.class 2KB
LoginWindow$3.class 2KB
LoginWindow$2.class 2KB
AdminServise.class 2KB
Library$9.class 2KB
ManagementWindow$15.class 2KB
JdbcUtil.class 2KB
ManagementWindow$28.class 2KB
DataBase.class 2KB
ManagementWindow$24.class 1KB
ManagementWindow$12.class 1KB
ManagementWindow$30.class 1KB
ManagementWindow$16.class 1KB
ManagementWindow$23.class 1KB
Library$10.class 1KB
Library$QueryBookTable$1.class 1KB
ManagementWindow$13.class 1KB
Library$11.class 1KB
Library$14.class 1013B
ManagementWindow$11.class 1001B
ManagementWindow$14.class 1000B
ManagementWindow$10.class 1000B
ManagementWindow$5.class 998B
ManagementWindow$7.class 998B
ManagementWindow$6.class 998B
ManagementWindow$8.class 998B
ManagementWindow$4.class 998B
ManagementWindow$2.class 998B
ManagementWindow$9.class 998B
ManagementWindow$3.class 998B
ManagementWindow$25.class 845B
ManagementWindow$26.class 842B
Library$QueryBookTable$2.class 838B
ManagementWindow$20.class 836B
ManagementWindow$21.class 836B
ManagementWindow$17.class 833B
ManagementWindow$18.class 833B
ManagementWindow$1.class 792B
BorrowAndReturnService.class 785B
Library$6.class 771B
Library$7.class 771B
LoginWindow$1.class 762B
LoginWindow$4.class 759B
LoginWindow$5.class 759B
Library$1.class 738B
Library$13.class 688B
Start$1.class 680B
Start.class 541B
.classpath 440B
mysql-connector-java-5.1.42-bin.jar 973KB
ManagementWindow.java 43KB
Library.java 29KB
LoginWindow.java 6KB
UserDao.java 6KB
BookDao.java 4KB
QueryBookTable.java 3KB
UserServise.java 3KB
BookServise.java 2KB
AdminServise.java 2KB
AdminDao.java 2KB
BorrowAndReturnDao.java 2KB
JdbcUtil.java 1KB
DataBase.java 1KB
test.java 1015B
BorrowAndReturnService.java 703B
Start.java 395B
UserUi.png 2.75MB
bookimg.png 1.99MB
MyBookList.png 1.99MB
My.png 1.99MB
Updataimg.png 1.99MB
main.png 1.24MB
BookDefault.png 232KB
login.png 159KB
management.png 101KB
bookall1.png 69KB
mybook.png 52KB
user1.png 52KB
bookall.png 52KB
共 108 条
- 1
- 2
资源评论
且行好事莫问前程
- 粉丝: 2w+
- 资源: 443
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功