From 1ae51d1a1c4732b21f8ff08b680014240794f9b7 Mon Sep 17 00:00:00 2001 From: Richard Schmidt Date: Tue, 6 Feb 2024 17:07:07 +0100 Subject: [PATCH] the signup window now closes automatically after completion --- src/main/java/SignUpGUI.java | 1 + user.json | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/main/java/SignUpGUI.java b/src/main/java/SignUpGUI.java index 520adb1..babf30d 100644 --- a/src/main/java/SignUpGUI.java +++ b/src/main/java/SignUpGUI.java @@ -56,6 +56,7 @@ public class SignUpGUI extends JFrame implements ActionListener { CreateUser user = CreateUser.createUser(randomUUID.toString(), username, password, birthday); user.saveToJsonFile("user.json"); JOptionPane.showMessageDialog(this, "User signed up successfully!"); + dispose(); } catch (IllegalArgumentException ex) { JOptionPane.showMessageDialog(this, "Error: " + ex.getMessage(), "Sign Up Error", JOptionPane.ERROR_MESSAGE); } diff --git a/user.json b/user.json index e407c0d..5cd130f 100644 --- a/user.json +++ b/user.json @@ -16,5 +16,11 @@ "userName": "asdasdasd", "password": "1231412512", "birthday": "1111111" + }, + { + "id": "f2775f81-564b-4101-8e86-ce879a9e7737", + "userName": "asd", + "password": "asdasdasd", + "birthday": "asd" } ] \ No newline at end of file