#8: Setup Modal Window

This commit is contained in:
Dominik Säume 2024-05-19 19:23:07 +02:00 committed by Dominik Säume
parent fb26756309
commit 092b436247
Signed by: SZUT-Dominik
GPG key ID: 67D15BB250B41E7C
4 changed files with 61 additions and 1 deletions

View file

@ -6,6 +6,7 @@ import javafx.application.Platform;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.control.TabPane; import javafx.scene.control.TabPane;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage; import javafx.stage.Stage;
import java.io.IOException; import java.io.IOException;
@ -33,7 +34,23 @@ public class Main extends Application {
@Override @Override
public void start(Stage primaryStage) { public void start(Stage primaryStage) {
this.primaryStage = 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();
}
} }
/** /**

View file

@ -0,0 +1,8 @@
package de.hitec.nhplus.login;
public class LoginController {
public void initialize() {
}
}

View file

@ -10,6 +10,9 @@ module de.hitec.nhplus {
exports de.hitec.nhplus.main; exports de.hitec.nhplus.main;
opens de.hitec.nhplus.main to javafx.base, javafx.fxml; 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;
exports de.hitec.nhplus.patient.database; exports de.hitec.nhplus.patient.database;
opens de.hitec.nhplus.patient.database to javafx.base, javafx.fxml; opens de.hitec.nhplus.patient.database to javafx.base, javafx.fxml;

View file

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<BorderPane
xmlns="http://javafx.com/javafx/17.0.2-ea"
xmlns:fx="http://javafx.com/fxml/1"
fx:controller="de.hitec.nhplus.login.LoginController"
minWidth="240"
maxWidth="240"
>
<padding>
<Insets bottom="8" left="8" right="8" top="8"/>
</padding>
<top>
<Label text="Anmeldung" BorderPane.alignment="CENTER" />
</top>
<center>
<VBox spacing="8">
<BorderPane.margin>
<Insets bottom="8.0" top="8.0"/>
</BorderPane.margin>
<TextField promptText="nutzername" VBox.vgrow="ALWAYS"/>
<PasswordField promptText="password" VBox.vgrow="ALWAYS"/>
</VBox>
</center>
<bottom>
<Button text="Bestätigen" BorderPane.alignment="CENTER" />
</bottom>
</BorderPane>