From 9aa49d7dfe445122edcf3e72c8e621493d21b8be Mon Sep 17 00:00:00 2001 From: pbg2h21ama Date: Tue, 31 Jan 2023 18:36:32 +0100 Subject: [PATCH] =?UTF-8?q?Registrierung=20erg=C3=A4nzt=20und=20Kommentar?= =?UTF-8?q?=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/vpr_javafx/HelloController.java | 22 +++++++++++- .../example/vpr_javafx/Registration-view.fxml | 36 ++++++++++++------- 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/example/vpr_javafx/HelloController.java b/src/main/java/com/example/vpr_javafx/HelloController.java index 20ec7bb..f4e89cc 100644 --- a/src/main/java/com/example/vpr_javafx/HelloController.java +++ b/src/main/java/com/example/vpr_javafx/HelloController.java @@ -94,6 +94,14 @@ public class HelloController { public TextField tfName; @FXML public TextField tfChild; + @FXML + public TextField tfStreet; + @FXML + public TextField tfHouseNumber; + @FXML + public TextField tfPostalCode; + @FXML + public TextField tfCity; @FXML private PasswordField pfPassword; @@ -279,6 +287,12 @@ public class HelloController { + "8: Konservierungsstoff"); } + /** + * ToRegistration() ruft die Registration-View auf, sobald man auf den Registrierungs-Button klickt + * @param event + * @throws IOException + * @author Kevin Maier + */ @FXML protected void ToRegistration(ActionEvent event) throws IOException { @@ -289,6 +303,12 @@ public class HelloController { stage.show(); } + /** + * OnRegistrationButton() lässt einen neuen Nutzer anlegen + * @param event + * @throws IOException + * @author Kevin Maier + */ @FXML protected void OnRegistrationButton(ActionEvent event) throws IOException { @@ -302,7 +322,7 @@ public class HelloController { else if (validData.validateData(tfPhone, pfPassword, this)) { try (FileWriter writer = new FileWriter("user.txt")){ - writer.write(tfName.getText() + ";" + tfPhone.getText() + ";" + tfChild.getText() + ";" + pfPassword.getText()); + writer.write(tfName.getText() + ";" + tfStreet.getText() + " " + tfHouseNumber.getText() + "," + tfPostalCode + " " + tfCity.getText() + ";" + tfPhone.getText() + ";" + tfChild.getText() + ";" + pfPassword.getText()); writer.flush(); } catch (IOException e) diff --git a/src/main/resources/com/example/vpr_javafx/Registration-view.fxml b/src/main/resources/com/example/vpr_javafx/Registration-view.fxml index 7a41d50..537e19a 100644 --- a/src/main/resources/com/example/vpr_javafx/Registration-view.fxml +++ b/src/main/resources/com/example/vpr_javafx/Registration-view.fxml @@ -1,14 +1,16 @@ + - + - - + + + @@ -17,18 +19,28 @@ + + -