From 45ad19eb4e5ae76131d509d48054e83668a4f7f8 Mon Sep 17 00:00:00 2001 From: qmstyle Date: Mon, 31 Mar 2025 14:25:12 +0800 Subject: [PATCH] =?UTF-8?q?2025=E5=B9=B43=E6=9C=8831=E6=97=A514:25:06?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 3 +++ .../zhangmeng/online/exam/ui/OnlineExamApplication.java | 9 ++++++--- src/main/resources/{fmxl => fxml}/index.fxml | 2 +- src/main/resources/{fmxl => fxml}/login.fxml | 2 +- src/main/resources/{fmxl => fxml}/role_form.fxml | 0 src/main/resources/{fmxl => fxml}/user_form.fxml | 0 6 files changed, 11 insertions(+), 5 deletions(-) rename src/main/resources/{fmxl => fxml}/index.fxml (89%) rename src/main/resources/{fmxl => fxml}/login.fxml (95%) rename src/main/resources/{fmxl => fxml}/role_form.fxml (100%) rename src/main/resources/{fmxl => fxml}/user_form.fxml (100%) diff --git a/pom.xml b/pom.xml index 97f7be4..12f2587 100644 --- a/pom.xml +++ b/pom.xml @@ -101,6 +101,9 @@ + + + \ No newline at end of file diff --git a/src/main/java/com/zhangmeng/online/exam/ui/OnlineExamApplication.java b/src/main/java/com/zhangmeng/online/exam/ui/OnlineExamApplication.java index 5bc5e6c..22ffa51 100644 --- a/src/main/java/com/zhangmeng/online/exam/ui/OnlineExamApplication.java +++ b/src/main/java/com/zhangmeng/online/exam/ui/OnlineExamApplication.java @@ -1,4 +1,5 @@ package com.zhangmeng.online.exam.ui; + import com.zhangmeng.online.exam.ui.admin.LoginPage; import javafx.application.Application; import javafx.beans.value.ChangeListener; @@ -19,8 +20,11 @@ public class OnlineExamApplication extends Application { @Override public void start(Stage stage) throws IOException { - - Scene scene = new Scene(new LoginPage()); + FXMLLoader loader = new FXMLLoader(OnlineExamApplication.class.getResource("/fxml/login.fxml")); + Parent root = loader.load(); + LoginPage loginPage = loader.getController(); + Scene scene = new Scene(root); +// Scene scene = new Scene(new LoginPage()); stage.setScene(scene); stage.setResizable(false); stage.setTitle("在线考试系统"); @@ -28,7 +32,6 @@ public class OnlineExamApplication extends Application { } - public static void main(String[] args) { launch(); } diff --git a/src/main/resources/fmxl/index.fxml b/src/main/resources/fxml/index.fxml similarity index 89% rename from src/main/resources/fmxl/index.fxml rename to src/main/resources/fxml/index.fxml index ba2ee30..077c07f 100644 --- a/src/main/resources/fmxl/index.fxml +++ b/src/main/resources/fxml/index.fxml @@ -8,7 +8,7 @@ diff --git a/src/main/resources/fmxl/login.fxml b/src/main/resources/fxml/login.fxml similarity index 95% rename from src/main/resources/fmxl/login.fxml rename to src/main/resources/fxml/login.fxml index 261bb81..e263be6 100644 --- a/src/main/resources/fmxl/login.fxml +++ b/src/main/resources/fxml/login.fxml @@ -10,7 +10,7 @@ - + diff --git a/src/main/resources/fmxl/role_form.fxml b/src/main/resources/fxml/role_form.fxml similarity index 100% rename from src/main/resources/fmxl/role_form.fxml rename to src/main/resources/fxml/role_form.fxml diff --git a/src/main/resources/fmxl/user_form.fxml b/src/main/resources/fxml/user_form.fxml similarity index 100% rename from src/main/resources/fmxl/user_form.fxml rename to src/main/resources/fxml/user_form.fxml