diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/AdminController.java b/src/main/java/com/bib/essensbestellungsverwaltung/AdminController.java new file mode 100644 index 0000000..6494355 --- /dev/null +++ b/src/main/java/com/bib/essensbestellungsverwaltung/AdminController.java @@ -0,0 +1,4 @@ +package com.bib.essensbestellungsverwaltung; + +public class AdminController { +} diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/HelloApplication.java b/src/main/java/com/bib/essensbestellungsverwaltung/HelloApplication.java index e0045a2..cd4f503 100644 --- a/src/main/java/com/bib/essensbestellungsverwaltung/HelloApplication.java +++ b/src/main/java/com/bib/essensbestellungsverwaltung/HelloApplication.java @@ -1,3 +1,8 @@ +/** + * @autor: Reshad Meher + * Fenstergrößer + * Fenstertitle + */ package com.bib.essensbestellungsverwaltung; import javafx.application.Application; @@ -8,18 +13,17 @@ import javafx.stage.Stage; import java.io.IOException; public class HelloApplication extends Application { + public static Stage primary; @Override public void start(Stage stage) throws IOException { - FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("hello-view.fxml")); - /** - * @autor: Reshad Meher - * Fenstergrößer - * Fenstertitle - */ - Scene scene = new Scene(fxmlLoader.load(), 480, 280); + FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("login-view.fxml")); + Scene scene = new Scene(fxmlLoader.load(), 950,480); + //stage = primary; stage.setTitle("Essen Bestellung im Kindergarten"); stage.setScene(scene); stage.show(); + + } public static void main(String[] args) { diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/LoginController.java b/src/main/java/com/bib/essensbestellungsverwaltung/LoginController.java new file mode 100644 index 0000000..6f3de77 --- /dev/null +++ b/src/main/java/com/bib/essensbestellungsverwaltung/LoginController.java @@ -0,0 +1,55 @@ +/*Richard Reiswich*/ +package com.bib.essensbestellungsverwaltung; + +import javafx.beans.NamedArg; +import javafx.fxml.FXML; +import javafx.fxml.FXMLLoader; +import javafx.scene.Scene; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.PasswordField; +import javafx.scene.control.TextField; +import javafx.stage.Stage; + +import java.io.IOException; +import java.util.HashMap; + +public class LoginController { + @FXML + private TextField tfEmail; + + @FXML + private PasswordField pfPassword; + + HashMap benutzerMap = new HashMap(); + @FXML + protected void onBtLoginClick() throws IOException { + benutzerMap.put("Reshad","1234"); + String email = tfEmail.getText(); + String password = pfPassword.getText(); + 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(); + }else { + Alert alert = new Alert(Alert.AlertType.ERROR,"Email oder Passwort ist falsch"); + alert.showAndWait(); + } + + tfEmail.setText(""); + pfPassword.setText(""); + } + @FXML + 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(); + + } +} diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java b/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java index 2c708ba..c52b33a 100644 --- a/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java +++ b/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java @@ -1,4 +1,25 @@ +/** + * Author: Reshad Meher + * Startseite + * fxml: menue-view.fxml + */ + package com.bib.essensbestellungsverwaltung; +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.scene.control.Alert; +import javafx.stage.Stage; + +import java.io.IOException; public class MenueController { + + @FXML + private void onBtLoginClick(){ + Alert alert = new Alert(Alert.AlertType.ERROR, "Hi"); + alert.showAndWait(); + } } diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/ParentController.java b/src/main/java/com/bib/essensbestellungsverwaltung/ParentController.java new file mode 100644 index 0000000..e862560 --- /dev/null +++ b/src/main/java/com/bib/essensbestellungsverwaltung/ParentController.java @@ -0,0 +1,4 @@ +package com.bib.essensbestellungsverwaltung; + +public class ParentController{ + } diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/SceneController.java b/src/main/java/com/bib/essensbestellungsverwaltung/SceneController.java new file mode 100644 index 0000000..57dca68 --- /dev/null +++ b/src/main/java/com/bib/essensbestellungsverwaltung/SceneController.java @@ -0,0 +1,12 @@ +package com.bib.essensbestellungsverwaltung; + +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; + +import java.io.IOException; +import java.util.Objects; + +public class SceneController { + +} diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/StartPageController.java b/src/main/java/com/bib/essensbestellungsverwaltung/StartPageController.java new file mode 100644 index 0000000..de9f111 --- /dev/null +++ b/src/main/java/com/bib/essensbestellungsverwaltung/StartPageController.java @@ -0,0 +1,4 @@ +package com.bib.essensbestellungsverwaltung; + +public class StartPageController { +} diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/adminMenue-view.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/adminMenue-view.fxml new file mode 100644 index 0000000..1577a9f --- /dev/null +++ b/src/main/resources/com/bib/essensbestellungsverwaltung/adminMenue-view.fxml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +