From 702677b65b2c3555b60763cb7c6632f64dc0a2a7 Mon Sep 17 00:00:00 2001 From: Reshad Meher Date: Mon, 23 Jan 2023 09:08:03 +0100 Subject: [PATCH] neue Zustand 23.01.23 --- .../HelloApplication.java | 2 +- .../LoginController.java | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/HelloApplication.java b/src/main/java/com/bib/essensbestellungsverwaltung/HelloApplication.java index cd4f503..6de9e87 100644 --- a/src/main/java/com/bib/essensbestellungsverwaltung/HelloApplication.java +++ b/src/main/java/com/bib/essensbestellungsverwaltung/HelloApplication.java @@ -18,7 +18,7 @@ public class HelloApplication extends Application { public void start(Stage stage) throws IOException { FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("login-view.fxml")); Scene scene = new Scene(fxmlLoader.load(), 950,480); - //stage = primary; + primary = stage; stage.setTitle("Essen Bestellung im Kindergarten"); stage.setScene(scene); stage.show(); diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/LoginController.java b/src/main/java/com/bib/essensbestellungsverwaltung/LoginController.java index 6f3de77..f5b3abd 100644 --- a/src/main/java/com/bib/essensbestellungsverwaltung/LoginController.java +++ b/src/main/java/com/bib/essensbestellungsverwaltung/LoginController.java @@ -1,4 +1,4 @@ -/*Richard Reiswich*/ +/*Reshad Meher*/ package com.bib.essensbestellungsverwaltung; import javafx.beans.NamedArg; @@ -17,7 +17,6 @@ import java.util.HashMap; public class LoginController { @FXML private TextField tfEmail; - @FXML private PasswordField pfPassword; @@ -30,15 +29,11 @@ public class LoginController { if(benutzerMap.containsKey(email) && benutzerMap.containsValue(password)){ FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("menue-view.fxml")); Scene scene = new Scene(fxmlLoader.load(), 950,480); - Stage stage = new Stage(); - stage.setTitle("Essen Bestellung im Kindergarten"); - stage.setScene(scene); - stage.show(); + HelloApplication.primary.setScene(scene); }else { Alert alert = new Alert(Alert.AlertType.ERROR,"Email oder Passwort ist falsch"); alert.showAndWait(); } - tfEmail.setText(""); pfPassword.setText(""); } @@ -46,10 +41,6 @@ public class LoginController { protected void changeToSignUp() throws IOException { FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("signUp-view.fxml")); Scene scene = new Scene(fxmlLoader.load(), 950,480); - Stage stage = new Stage(); - stage.setTitle("Essen Bestellung im Kindergarten"); - stage.setScene(scene); - stage.show(); - + HelloApplication.primary.setScene(scene); } }