From 4b465ab4e0c5d56bd80c7959852a8738fdb09784 Mon Sep 17 00:00:00 2001 From: Luca Date: Thu, 22 Feb 2024 20:16:42 +0100 Subject: [PATCH] Login GUI --- .idea/runConfigurations/HelloApplication.xml | 17 ----------------- .../elrant/bubbles/gui/HelloApplication.java | 2 +- .../elrant/bubbles/gui/HelloController.java | 15 +++++++++++---- .../elrant/bubbles/xmpp/SimpleXMPPClient.java | 4 ++-- .../team/elrant/bubbles/gui/hello-view.fxml | 14 -------------- 5 files changed, 14 insertions(+), 38 deletions(-) delete mode 100644 .idea/runConfigurations/HelloApplication.xml delete mode 100644 src/main/resources/team/elrant/bubbles/gui/hello-view.fxml diff --git a/.idea/runConfigurations/HelloApplication.xml b/.idea/runConfigurations/HelloApplication.xml deleted file mode 100644 index 7209e59..0000000 --- a/.idea/runConfigurations/HelloApplication.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/main/java/team/elrant/bubbles/gui/HelloApplication.java b/src/main/java/team/elrant/bubbles/gui/HelloApplication.java index 85faf65..8c39b31 100644 --- a/src/main/java/team/elrant/bubbles/gui/HelloApplication.java +++ b/src/main/java/team/elrant/bubbles/gui/HelloApplication.java @@ -4,7 +4,6 @@ import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.stage.Stage; - import java.io.IOException; public class HelloApplication extends Application { @@ -20,4 +19,5 @@ public void start(@org.jetbrains.annotations.NotNull Stage stage) throws IOExcep public static void main(String[] args) { launch(); } + } \ No newline at end of file diff --git a/src/main/java/team/elrant/bubbles/gui/HelloController.java b/src/main/java/team/elrant/bubbles/gui/HelloController.java index 398bd02..d1910ed 100644 --- a/src/main/java/team/elrant/bubbles/gui/HelloController.java +++ b/src/main/java/team/elrant/bubbles/gui/HelloController.java @@ -1,14 +1,21 @@ package team.elrant.bubbles.gui; import javafx.fxml.FXML; -import javafx.scene.control.Label; +import javafx.scene.control.PasswordField; +import javafx.scene.control.TextField; +import team.elrant.bubbles.xmpp.ConnectedUser; public class HelloController { @FXML - private Label welcomeText; + private TextField username_field; + @FXML + private PasswordField password_field; @FXML - protected void onHelloButtonClick() { - welcomeText.setText("Welcome to JavaFX Application!"); + protected void onSubmitButtonClick() { + ConnectedUser user = new ConnectedUser(username_field.getText(), password_field.getText(), "elrant.team"); + user.initializeConnection(); + user.disconnect(); + System.exit(0); } } \ No newline at end of file diff --git a/src/main/java/team/elrant/bubbles/xmpp/SimpleXMPPClient.java b/src/main/java/team/elrant/bubbles/xmpp/SimpleXMPPClient.java index f49f447..cca48c4 100644 --- a/src/main/java/team/elrant/bubbles/xmpp/SimpleXMPPClient.java +++ b/src/main/java/team/elrant/bubbles/xmpp/SimpleXMPPClient.java @@ -4,8 +4,8 @@ public class SimpleXMPPClient { public static void main(String[] args) { // XMPP connection details - String username = ""; - String password = ""; + String username = "username"; + String password = "password"; String serviceName = "elrant.team"; ConnectedUser user = new ConnectedUser(username, password, serviceName); diff --git a/src/main/resources/team/elrant/bubbles/gui/hello-view.fxml b/src/main/resources/team/elrant/bubbles/gui/hello-view.fxml deleted file mode 100644 index 1321994..0000000 --- a/src/main/resources/team/elrant/bubbles/gui/hello-view.fxml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - -