From 092b4362473247030dda5f816353817b448138a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20S=C3=A4ume?= Date: Sun, 19 May 2024 19:23:07 +0200 Subject: [PATCH 1/7] #8: Setup Modal Window --- src/main/java/de/hitec/nhplus/Main.java | 19 ++++++++++- .../hitec/nhplus/login/LoginController.java | 8 +++++ src/main/java/module-info.java | 3 ++ .../de/hitec/nhplus/login/LoginView.fxml | 32 +++++++++++++++++++ 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 src/main/java/de/hitec/nhplus/login/LoginController.java create mode 100644 src/main/resources/de/hitec/nhplus/login/LoginView.fxml diff --git a/src/main/java/de/hitec/nhplus/Main.java b/src/main/java/de/hitec/nhplus/Main.java index 42d99f8..f8a6e87 100644 --- a/src/main/java/de/hitec/nhplus/Main.java +++ b/src/main/java/de/hitec/nhplus/Main.java @@ -6,6 +6,7 @@ import javafx.application.Platform; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.scene.control.TabPane; +import javafx.scene.layout.BorderPane; import javafx.stage.Stage; import java.io.IOException; @@ -33,7 +34,23 @@ public class Main extends Application { @Override public void start(Stage primaryStage) { this.primaryStage = primaryStage; - executeMainApplication(); + executePassword(); + //executeMainApplication(); + } + + private void executePassword() { + try { + + FXMLLoader loader = new FXMLLoader(Main.class.getResource("/de/hitec/nhplus/login/LoginView.fxml")); + BorderPane pane = loader.load(); + Scene scene = new Scene(pane); + this.primaryStage.setTitle("NHPlus"); + this.primaryStage.setScene(scene); + this.primaryStage.setResizable(true); + this.primaryStage.show(); + } catch (IOException exception) { + exception.printStackTrace(); + } } /** diff --git a/src/main/java/de/hitec/nhplus/login/LoginController.java b/src/main/java/de/hitec/nhplus/login/LoginController.java new file mode 100644 index 0000000..1ab43b8 --- /dev/null +++ b/src/main/java/de/hitec/nhplus/login/LoginController.java @@ -0,0 +1,8 @@ +package de.hitec.nhplus.login; + +public class LoginController { + + public void initialize() { + + } +} diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 06e67a7..56fcea2 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -10,6 +10,9 @@ module de.hitec.nhplus { exports de.hitec.nhplus.main; opens de.hitec.nhplus.main to javafx.base, javafx.fxml; + exports de.hitec.nhplus.login; + opens de.hitec.nhplus.login to javafx.base, javafx.fxml; + exports de.hitec.nhplus.patient; exports de.hitec.nhplus.patient.database; opens de.hitec.nhplus.patient.database to javafx.base, javafx.fxml; diff --git a/src/main/resources/de/hitec/nhplus/login/LoginView.fxml b/src/main/resources/de/hitec/nhplus/login/LoginView.fxml new file mode 100644 index 0000000..2a3212d --- /dev/null +++ b/src/main/resources/de/hitec/nhplus/login/LoginView.fxml @@ -0,0 +1,32 @@ + + + + + + + + + + + + +
+ + + + + + + +
+ +