#8: Setup Modal Window
This commit is contained in:
parent
700aba10b7
commit
5106151b3b
4 changed files with 61 additions and 1 deletions
|
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
8
src/main/java/de/hitec/nhplus/login/LoginController.java
Normal file
8
src/main/java/de/hitec/nhplus/login/LoginController.java
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
package de.hitec.nhplus.login;
|
||||||
|
|
||||||
|
public class LoginController {
|
||||||
|
|
||||||
|
public void initialize() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -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;
|
||||||
|
|
32
src/main/resources/de/hitec/nhplus/login/LoginView.fxml
Normal file
32
src/main/resources/de/hitec/nhplus/login/LoginView.fxml
Normal 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>
|
Loading…
Reference in a new issue