package main.view;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import main.util.DBTool;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
public class Main extends Application {
private static Stage stage;
private static Connection connection;
public Connection getConnection(){
return connection;
}
@Override
public void start(Stage stage) throws Exception {
Main.stage = stage;
initLogin();
}
@Override
public void init() throws SQLException {
connection = DBTool.getConnetion();
}
public void initLogin() throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("../../resources/login.fxml"));
Parent root = fxmlLoader.load();
Scene login = new Scene(root);
Main.stage.setScene(login);
Main.stage.setResizable(false);
Main.stage.setTitle("广师大图书管理系统");
Main.stage.getIcons().add(new Image("resources/image/logo.png"));
Main.stage.show();
}
public void initRegister() throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("../../resources/userRegister.fxml"));
Parent root = fxmlLoader.load();
Scene register = new Scene(root);
Main.stage.setScene(register);
Main.stage.setTitle("注册页面");
Main.stage.getIcons().add(new Image("https://xingqiu-tuchuang-1256524210.cos.ap-shanghai.myqcloud.com/434/202207080016504.png"));
Main.stage.getIcons().add(new Image("resources/image/logo.png"));
Main.stage.show();
}
public void initRootLogin() throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("../../resources/rootLogin.fxml"));
Parent root = fxmlLoader.load();
Scene register = new Scene(root);
Main.stage.setScene(register);
Main.stage.setTitle("管理员登录");
Main.stage.getIcons().add(new Image("https://xingqiu-tuchuang-1256524210.cos.ap-shanghai.myqcloud.com/434/202207080016504.png"));
Main.stage.getIcons().add(new Image("resources/image/logo.png"));
Main.stage.show();
}
public void initUserMenu() throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("../../resources/userMenu.fxml"));
Parent root = fxmlLoader.load();
Scene usermenu = new Scene(root);
Main.stage.setScene(usermenu);
Main.stage.setTitle("借阅界面");
Main.stage.getIcons().add(new Image("https://xingqiu-tuchuang-1256524210.cos.ap-shanghai.myqcloud.com/434/202207080016504.png"));
Main.stage.getIcons().add(new Image("resources/image/logo.png"));
Main.stage.show();
}
public void initAdminMenu() throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("../../resources/adminMenu.fxml"));
Parent root = fxmlLoader.load();
Scene adminmenu = new Scene(root);
Main.stage.setScene(adminmenu);
Main.stage.setTitle("管理员模式");
Main.stage.getIcons().add(new Image("resources/image/logo.png"));
Main.stage.show();
}
public void initBackBook() throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("../../resources/returnBook.fxml"));
Parent root = fxmlLoader.load();
Scene backBook = new Scene(root);
Main.stage.setScene(backBook);
Main.stage.setTitle("还书窗口");
Main.stage.getIcons().add(new Image("resources/image/logo.png"));
Main.stage.show();
}
public void initBorrowBook() throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("../../resources/borrowBook.fxml"));
Parent root = fxmlLoader.load();
Scene borrowBook = new Scene(root);
Main.stage.setScene(borrowBook);
Main.stage.setTitle("借书窗口");
Main.stage.getIcons().add(new Image("resources/image/logo.png"));
Main.stage.show();
}
public void initBookInLibrary() throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("../../resources/bookStorage.fxml"));
Parent root = fxmlLoader.load();
Scene booksInLibrary = new Scene(root);
Main.stage.setScene(booksInLibrary);
Main.stage.setTitle("图书入库窗口");
Main.stage.getIcons().add(new Image("resources/image/logo.png"));
Main.stage.show();
}
public void changeUserInformation() throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("../../resources/changeUserInformation.fxml"));
Parent root = fxmlLoader.load();
Scene changeUserInformation = new Scene(root);
Main.stage.setScene(changeUserInformation);
Main.stage.setTitle("用户信息修改窗口");
Main.stage.getIcons().add(new Image("resources/image/logo.png"));
Main.stage.show();
}
public void bindStatus() throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("../../resources/bindStatus.fxml"));
Parent root = fxmlLoader.load();
Scene disabledState = new Scene(root);
Main.stage.setScene(disabledState);
Main.stage.setTitle("账号状态");
Main.stage.getIcons().add(new Image("resources/image/logo.png"));
Main.stage.show();
}
public void mangeBook() throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("../../resources/mangeBook.fxml"));
Parent root = fxmlLoader.load();
Scene mangeBook = new Scene(root);
Main.stage.setScene(mangeBook);
Main.stage.setTitle("管理图书");
Main.stage.getIcons().add(new Image("resources/image/logo.png"));
Main.stage.show();
}
public void typeBook() throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("../../resources/typeBook.fxml"));
Parent root = fxmlLoader.load();
Scene mangeBook = new Scene(root);
Main.stage.setScene(mangeBook);
Main.stage.setTitle("管理图书");
Main.stage.getIcons().add(new Image("resources/image/logo.png"));
Main.stage.show();
}
public void exit() throws IOException {
// DBTool.close(connection);
// Main.stage.close();
initLogin();
}
public static void main(String[] args) {
launch(args);
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
使用JavaFX和mysql开发的桌面应用:图书管理系统源码.zip (98个子文件)
java-training-master
LICENSE 34KB
bookMange
bookMange.iml 925B
src
META-INF
MANIFEST.MF 50B
resources
login.fxml 2KB
mangeBook.fxml 4KB
userMenu.fxml 2KB
image
background02.png 22KB
logo.png 98KB
background01.jpg 775KB
background03.png 6KB
changeUserInformation.fxml 4KB
borrowBook.fxml 4KB
typeBook.fxml 2KB
userRegister.fxml 2KB
rootLogin.fxml 2KB
returnBook.fxml 3KB
bookStorage.fxml 3KB
bindStatus.fxml 3KB
adminMenu.fxml 2KB
main
dao
BookStorageDB.java 2KB
HistoryDB.java 2KB
RegisterDB.java 686B
UserTableDB.java 733B
BookTableDB.java 522B
LoginDB.java 990B
model
User.java 2KB
Book.java 3KB
view
Main.java 7KB
controller
BookStorage.java 2KB
ReturnBook.java 2KB
Login.java 2KB
RootLogin.java 2KB
BindStatus.java 631B
BorrowBook.java 2KB
MangeBook.java 2KB
ChangeUserInformation.java 2KB
UserMenu.java 731B
UserRegister.java 2KB
TypeBook.java 832B
AdminMenu.java 1KB
util
db.properties 138B
DBTool.java 3KB
.idea
dataSources.xml 519B
uiDesigner.xml 9KB
misc.xml 273B
vcs.xml 229B
modules.xml 258B
.gitignore 176B
artifacts
bookMange.xml 886B
inspectionProfiles
Project_Default.xml 1KB
sqldialects.xml 215B
out
production
bookMange
META-INF
MANIFEST.MF 50B
resources
login.fxml 2KB
mangeBook.fxml 4KB
userMenu.fxml 2KB
image
background02.png 22KB
logo.png 98KB
background01.jpg 775KB
background03.png 6KB
changeUserInformation.fxml 4KB
borrowBook.fxml 4KB
typeBook.fxml 2KB
userRegister.fxml 2KB
rootLogin.fxml 2KB
returnBook.fxml 3KB
bookStorage.fxml 3KB
bindStatus.fxml 3KB
adminMenu.fxml 2KB
main
dao
UserTableDB.class 1KB
RegisterDB.class 1KB
BookTableDB.class 1024B
LoginDB.class 2KB
HistoryDB.class 3KB
BookStorageDB.class 2KB
model
User.class 2KB
Book.class 3KB
view
Main.class 5KB
controller
RootLogin.class 2KB
MangeBook.class 3KB
BorrowBook.class 3KB
ChangeUserInformation.class 3KB
BindStatus.class 1014B
AdminMenu.class 1KB
UserMenu.class 1KB
TypeBook.class 1KB
ReturnBook.class 3KB
Login.class 3KB
UserRegister.class 2KB
BookStorage.class 2KB
util
DBTool.class 2KB
db.properties 138B
artifacts
bookMange
bookMange.jar 934KB
bookMange.jnlp 710B
mysql-connector-java-5.1.36.jar 949KB
bookMange.html 1KB
jfoenix.jar 2.58MB
lib
mysql-connector-java-5.1.36.jar 949KB
jfoenix.jar 2.58MB
共 98 条
- 1
资源评论
- wjc27??2022-09-29资源很好用,有较大的参考价值,资源不错,支持一下。
「已注销」
- 粉丝: 794
- 资源: 3613
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 高性能量化工具 hikyuu 2.0.3 python3.9 ubuntu 安装包
- Cyclone Version 9.51
- 高性能量化回测工具 hikyuu 2.0.3 python 3.12 windows 安装包
- 省级城乡居民基本养老保险情况数据集(2010-2022年).xlsx
- 舞队填写版.cpp
- 基于BP神经网络的多输入单输出回归预测.zip
- 高性能量化回测工具 hikyuu 2.0.3 python 3.9 windows 安装包
- 省级城镇职工基本养老保险情况2000-2022年.xlsx
- 高性能量化回测工具 hikyuu 2.0.3 python 3.10 windows 安装包
- 算法部署-使用OpenVINO+C#部署PaddleOCR字符识别算法-项目源码-优质项目实战.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功