Bläddra i källkod

Added login window

Veloe 4 år sedan
förälder
incheckning
3e2c8892a6

+ 4 - 0
connection.properties

@@ -0,0 +1,4 @@
+
+CONFIG_DEFAULT_HOST = 192.168.1.119/moviesdb
+CONFIG_DEFAULT_USER = Guest
+CONFIG_DEFAULT_PASS = Password1*

BIN
out/production/JavaFxApplication/com/moviesdb/Controller.class


BIN
out/production/JavaFxApplication/com/moviesdb/Main.class


+ 26 - 124
out/production/JavaFxApplication/com/moviesdb/test.fxml

@@ -32,132 +32,34 @@
   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
 
-<?import javafx.geometry.Insets?>
+<?import javafx.scene.control.Button?>
 <?import javafx.scene.control.Label?>
-<?import javafx.scene.control.Menu?>
-<?import javafx.scene.control.MenuBar?>
-<?import javafx.scene.control.MenuItem?>
-<?import javafx.scene.control.ScrollPane?>
-<?import javafx.scene.control.SeparatorMenuItem?>
-<?import javafx.scene.control.SplitPane?>
+<?import javafx.scene.control.TextField?>
 <?import javafx.scene.layout.AnchorPane?>
-<?import javafx.scene.layout.ColumnConstraints?>
-<?import javafx.scene.layout.GridPane?>
-<?import javafx.scene.layout.HBox?>
 <?import javafx.scene.layout.Pane?>
-<?import javafx.scene.layout.RowConstraints?>
-<?import javafx.scene.layout.VBox?>
-<?import javafx.scene.paint.Color?>
 <?import javafx.scene.text.Font?>
+<?import javafx.scene.text.TextFlow?>
 
-<VBox prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.Controller">
-  <children>
-    <MenuBar style="-fx-background-color: #121212;" VBox.vgrow="NEVER">
-      <menus>
-        <Menu mnemonicParsing="false" text="File">
-          <items>
-            <MenuItem fx:id="menuNew" mnemonicParsing="false" onAction="#loadPosters" text="New" />
-            <MenuItem mnemonicParsing="false" text="Open…" />
-            <Menu mnemonicParsing="false" text="Open Recent" />
-            <SeparatorMenuItem mnemonicParsing="false" />
-            <MenuItem mnemonicParsing="false" text="Close" />
-            <MenuItem mnemonicParsing="false" text="Save" />
-            <MenuItem mnemonicParsing="false" text="Save As…" />
-            <MenuItem mnemonicParsing="false" text="Revert" />
-            <SeparatorMenuItem mnemonicParsing="false" />
-            <MenuItem mnemonicParsing="false" text="Preferences…" />
-            <SeparatorMenuItem mnemonicParsing="false" />
-            <MenuItem mnemonicParsing="false" text="Quit" />
-          </items>
-        </Menu>
-        <Menu mnemonicParsing="false" text="Edit">
-          <items>
-            <MenuItem mnemonicParsing="false" text="Undo" />
-            <MenuItem mnemonicParsing="false" text="Redo" />
-            <SeparatorMenuItem mnemonicParsing="false" />
-            <MenuItem mnemonicParsing="false" text="Cut" />
-            <MenuItem mnemonicParsing="false" text="Copy" />
-            <MenuItem mnemonicParsing="false" text="Paste" />
-            <MenuItem mnemonicParsing="false" text="Delete" />
-            <SeparatorMenuItem mnemonicParsing="false" />
-            <MenuItem mnemonicParsing="false" text="Select All" />
-            <MenuItem mnemonicParsing="false" text="Unselect All" />
-          </items>
-        </Menu>
-        <Menu mnemonicParsing="false" text="Help">
-          <items>
-            <MenuItem mnemonicParsing="false" text="About MyHelloApp" />
-          </items>
-        </Menu>
-      </menus>
-    </MenuBar>
-    <SplitPane dividerPositions="0.2516703786191537, 0.8897550111358574" focusTraversable="true" prefHeight="-1.0" prefWidth="-1.0" style="-fx-background-color: #121212; -fx-box-border: transparent;" VBox.vgrow="ALWAYS">
-      <items>
-        <AnchorPane fx:id="filterPane" minWidth="0.0" prefHeight="551.0" prefWidth="194.0" scaleShape="false" style="-fx-background-color: #212121;" SplitPane.resizableWithParent="false">
-               <children>
-            <Label alignment="CENTER" layoutX="12.0" layoutY="14.0" minWidth="60.0" prefWidth="-1.0" style="&#10;" text="Filter" textAlignment="CENTER" wrapText="false">
-              <font>
-                <Font size="18.0" fx:id="x1" />
-              </font>
-              <textFill>
-                <Color red="0.624" green="0.624" blue="0.624" fx:id="x2" />
-              </textFill>
-            </Label>
-                  <GridPane fx:id="moviesGrid" alignment="CENTER" layoutX="-34.0" layoutY="120.0" prefHeight="191.0" prefWidth="224.0" style="-fx-background-color: #303030;">
-                    <columnConstraints>
-                        <ColumnConstraints hgrow="SOMETIMES" maxWidth="108.0" minWidth="10.0" prefWidth="104.0" />
-                        <ColumnConstraints hgrow="SOMETIMES" maxWidth="108.0" minWidth="10.0" prefWidth="104.0" />
-                      <ColumnConstraints hgrow="SOMETIMES" maxWidth="108.0" minWidth="10.0" prefWidth="104.0" />
-                      <ColumnConstraints hgrow="SOMETIMES" maxWidth="107.0" minWidth="10.0" prefWidth="96.0" />
-                    </columnConstraints>
-                    <rowConstraints>
-                        <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
-                      <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
-                      <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
-                      <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
-                    </rowConstraints>
-                  </GridPane>
-               </children>
-        </AnchorPane>
-        <ScrollPane style="-fx-background-color: #212121;">
-          <content>
-            <AnchorPane id="Content" fx:id="moviesPane" minHeight="-1.0" minWidth="0.0" prefWidth="0.0" style="-fx-background-color: #212121;">
-              <children>
-                <Label alignment="CENTER" layoutX="14.0" layoutY="14.0" style="&#10;" text="Browser" textAlignment="CENTER" wrapText="false">
-                           <textFill>
-                              <Color red="0.624" green="0.624" blue="0.624" fx:id="x5" />
-                           </textFill>
-                           <font>
-                              <Font size="18.0" fx:id="x6" />
-                           </font>
-                        </Label>
-              </children>
-            </AnchorPane>
-          </content>
-        </ScrollPane>
-        <AnchorPane fx:id="detailsPanel" minWidth="0.0" prefWidth="0.0" style="-fx-background-color: #212121;" SplitPane.resizableWithParent="false">
-          <children>
-            <Label alignment="CENTER" font="$x1" layoutX="7.0" layoutY="14.0" style="&#10;" text="Details" textAlignment="CENTER" textFill="$x2" wrapText="false" />
-          </children>
-        </AnchorPane>
-      </items>
-    </SplitPane>
-    <HBox id="HBox" alignment="CENTER_LEFT" spacing="5.0" style="-fx-background-color: #121212;" VBox.vgrow="NEVER">
-      <children>
-        <Label maxHeight="1.7976931348623157E308" maxWidth="-1.0" style="-fx-background-color: #121212;" text="Logged as Guest" HBox.hgrow="ALWAYS">
-          <font>
-            <Font size="11.0" fx:id="x3" />
-          </font>
-          <textFill>
-            <Color red="0.625" green="0.625" blue="0.625" fx:id="x4" />
-          </textFill>
-        </Label>
-        <Pane prefHeight="-1.0" prefWidth="-1.0" style="-fx-background-color: #121212;" HBox.hgrow="ALWAYS" />
-        <Label font="$x3" maxWidth="-1.0" style="-fx-background-color: #121212;" text="Log in" textFill="$x4" HBox.hgrow="NEVER" />
-      </children>
-      <padding>
-        <Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
-      </padding>
-    </HBox>
-  </children>
-</VBox>
+<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="175.0" prefWidth="250.0" style="-fx-background-color: #121212;" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.Controller">
+   <children>
+      <Label layoutX="14.0" layoutY="14.0" text="Log in" textFill="#9f9f9f">
+         <font>
+            <Font size="24.0" />
+         </font>
+      </Label>
+      <TextField fx:id="userTextBox" layoutX="80.0" layoutY="49.0" style="-fx-background-color: #121212; -fx-text-fill: #9f9f9f;" />
+      <TextField fx:id="passTextBox" layoutX="80.0" layoutY="92.0" style="-fx-background-color: #121212; -fx-text-fill: #9f9f9f;" />
+      <Label layoutX="14.0" layoutY="55.0" text="Username" textFill="#9f9f9f">
+         <font>
+            <Font size="14.0" />
+         </font></Label>
+      <Label layoutX="14.0" layoutY="96.0" text="Password" textFill="#9f9f9f">
+         <font>
+            <Font size="14.0" />
+         </font></Label>
+      <Button fx:id="logInButton2" layoutX="190.0" layoutY="141.0" mnemonicParsing="false" onMouseClicked="#closeLoginForm" style="-fx-background-color: #9f9f9f;" text="Sign in" AnchorPane.bottomAnchor="15.0" AnchorPane.rightAnchor="15.0" />
+      <Pane layoutX="80.0" layoutY="75.0" prefHeight="3.0" prefWidth="149.0" style="-fx-background-color: #9f9f9f;" />
+      <Pane layoutX="80.0" layoutY="117.0" prefHeight="3.0" prefWidth="149.0" style="-fx-background-color: #9f9f9f;" />
+      <TextFlow fx:id="errorTextBox" layoutX="14.0" layoutY="134.0" prefHeight="25.0" prefWidth="159.0" />
+   </children>
+</AnchorPane>

+ 2 - 2
out/production/JavaFxApplication/com/moviesdb/test2.fxml

@@ -151,7 +151,7 @@
     </SplitPane>
     <HBox id="HBox" alignment="CENTER_LEFT" spacing="5.0" VBox.vgrow="NEVER">
       <children>
-        <Label maxHeight="1.7976931348623157E308" maxWidth="-1.0" style="-fx-background-color: #121212;" text="Logged in as Guest" HBox.hgrow="ALWAYS">
+        <Label fx:id="userLabel" maxHeight="1.7976931348623157E308" maxWidth="-1.0" style="-fx-background-color: #121212;" text="Logged in as Guest" HBox.hgrow="ALWAYS">
           <font>
             <Font size="11.0" fx:id="x3" />
           </font>
@@ -160,7 +160,7 @@
           </textFill>
         </Label>
         <Pane prefHeight="-1.0" prefWidth="-1.0" style="-fx-background-color: #121212;" HBox.hgrow="ALWAYS" />
-        <Label fx:id="logInButton" font="$x3" maxWidth="-1.0" style="-fx-background-color: #121212;" text="Log in" textFill="$x4" HBox.hgrow="NEVER" />
+        <Label fx:id="logInButton" font="$x3" maxWidth="-1.0" onMouseClicked="#openLoginForm" style="-fx-background-color: #121212;" text="Log in" textFill="$x4" HBox.hgrow="NEVER" />
       </children>
       <padding>
         <Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />

+ 94 - 21
src/com/moviesdb/Controller.java

@@ -6,6 +6,7 @@ import javafx.fxml.FXML;
 import javafx.geometry.HPos;
 import javafx.geometry.Pos;
 import javafx.geometry.VPos;
+import javafx.scene.Node;
 import javafx.scene.control.*;
 import javafx.scene.image.Image;
 import javafx.scene.image.ImageView;
@@ -20,11 +21,16 @@ import com.moviesdb.Movie;
 import javafx.scene.text.Text;
 import javafx.scene.text.TextFlow;
 import com.moviesdb.DataBaseConnector;
+import javafx.stage.Modality;
 import javafx.stage.Stage;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.fxml.FXMLLoader;
 
+import java.io.FileInputStream;
+import java.io.IOException;
 import java.time.chrono.AbstractChronology;
-import java.util.LinkedHashMap;
-import java.util.Map;
+import java.util.*;
 //For reading properties from .properties file
 import com.moviesdb.ConnectionParams;
 
@@ -47,8 +53,7 @@ public class Controller {
     @FXML
     AnchorPane filterPane;
     @FXML
-            Label button;
-
+    Label button;
     @FXML
     Label minimizeButton;
     @FXML
@@ -58,13 +63,24 @@ public class Controller {
     @FXML
     Label logInButton;
     @FXML
+    Button logInButton2;
+    @FXML
     MenuBar menuPane;
 
+    @FXML
+            TextField userTextBox;
+    @FXML
+            TextField passTextBox;
+    @FXML
+            TextFlow errorTextBox;
+    @FXML
+            Label userLabel;
+
     Map<Label, Movie> map;
     Label[] labelsMovies;
     Movie[] movies;
     Movie my_movie;
-    DataBaseConnector my_connector;
+    public DataBaseConnector my_connector;
     ConnectionParams workParams;
 
     double xOffset;
@@ -117,8 +133,8 @@ public class Controller {
             }
         });
 
-        //TODO change path to connection.properties
-        workParams = new ConnectionParams("src/com/moviesdb/connection.properties");
+
+        workParams = new ConnectionParams("connection.properties");
         if (!workParams.initilized())
             //TODO this is temporaly handler
             System.out.println(workParams.getInitilizeErrCause().toString());
@@ -316,27 +332,84 @@ public class Controller {
         }
     }
 
-    private void openLoginForm(){
-        //TODO Followed Must be on some button
-        if (!newArgLogin())
-            System.out.println("Login error!");
-        else
-            closeLoginForm();
+    public void openLoginForm(){
+
+        Parent root;
+        try {
+            FXMLLoader loader = new FXMLLoader();
+            loader.setLocation(getClass().getResource("test.fxml"));
+            root = loader.load();
+            //root = FXMLLoader.load(getClass().getClassLoader().getResource("test.fxml"));
+            Stage stage = new Stage();
+            stage.initModality(Modality.WINDOW_MODAL);
+            stage.initOwner(browserPane.getScene().getWindow());
+            stage.setTitle("Log in");
+            stage.setScene(new Scene(root, 250, 175));
+            stage.show();
+            // Hide this current window (if this is what you want)
+            //((Node)(event.getSource())).getScene().getWindow().hide();
+        }
+        catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        //if (!newArgLogin())
+        //    System.out.println("Login error!");
+        //else
+        //    closeLoginForm();
     }
 
-    private void closeLoginForm(){
-        //TODO Actually closing LoginForm
-        System.out.println("LoginForm closed");
+    public void closeLoginForm(){
+
+        Stage stage = (Stage) logInButton2.getScene().getWindow();
+        Stage parent = (Stage) stage.getOwner();
+        Controller controller = new Controller();
+        FXMLLoader loader = (FXMLLoader) parent.getUserData();
+        controller = loader.getController();
+         //controller.initialize(parent);
+        if(controller.newArgLogin(userTextBox.getText(), passTextBox.getText())) {
+            stage.close();
+        }
+        else
+        {
+            Text errorMessage = new Text("Incorrect login or password!");
+            errorMessage.setStyle("-fx-font-size: 14; -fx-fill: #FF0000;");
+            errorTextBox.getChildren().add(errorMessage);
+        }
+        //System.out.println("LoginForm closed");
     }
 
-    private Boolean newArgLogin(){
-        //TODO Change Hardcoded values to input fields from LoginForm
-        ConnectionParams temooralParams  = new ConnectionParams("192.168.192.1/moviesdb","Veloe", "Password1*");
-        if (my_connector.tryConnection(temooralParams)){
-            workParams = temooralParams;
+    private Boolean newArgLogin(String user, String pass){
+
+        Properties property = new Properties();
+        ConnectionParams temporalParams;
+        try {
+            FileInputStream fis = new FileInputStream("connection.properties");
+            property.load(fis);
+            temporalParams  = new ConnectionParams(property.getProperty("CONFIG_DEFAULT_HOST"), user, pass);
+        }
+        catch (IOException ex)
+        {
+            temporalParams  = new ConnectionParams("127.0.0.1/moviesdb", user, pass);
+        }
+
+        if (my_connector.tryConnection(temporalParams)){
+            workParams = temporalParams;
             my_connector.initConnection(workParams);
+            setUserName(user);
             return my_connector.initialized();
         }
+        else
+        {
+            ConnectionParams defaultParams  = new ConnectionParams("connection.properties");
+            setUserName("Guest");
+            my_connector.initConnection(defaultParams);
+        }
         return false;
     }
+
+    public void setUserName(String name)
+    {
+        userLabel.setText("Logged in as " + name);
+    }
 }

+ 1 - 1
src/com/moviesdb/Main.java

@@ -22,7 +22,7 @@ public class Main extends Application {
         loader.setLocation(getClass().getResource("test2.fxml"));
         Parent root = loader.load();
         primaryStage.initStyle(StageStyle.UNDECORATED);
-
+        primaryStage.setUserData(loader);
         primaryStage.setTitle("Hello World");
         primaryStage.setScene(new Scene(root, 1280, 720));
         Controller controller = loader.getController();

+ 0 - 4
src/com/moviesdb/connection.properties

@@ -1,4 +0,0 @@
-
-CONFIG_DEFAULT_HOST = 192.168.1.119/moviesdb
-CONFIG_DEFAULT_USER = Veloe
-CONFIG_DEFAULT_PASS = Password1*

+ 26 - 124
src/com/moviesdb/test.fxml

@@ -32,132 +32,34 @@
   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
 
-<?import javafx.geometry.Insets?>
+<?import javafx.scene.control.Button?>
 <?import javafx.scene.control.Label?>
-<?import javafx.scene.control.Menu?>
-<?import javafx.scene.control.MenuBar?>
-<?import javafx.scene.control.MenuItem?>
-<?import javafx.scene.control.ScrollPane?>
-<?import javafx.scene.control.SeparatorMenuItem?>
-<?import javafx.scene.control.SplitPane?>
+<?import javafx.scene.control.TextField?>
 <?import javafx.scene.layout.AnchorPane?>
-<?import javafx.scene.layout.ColumnConstraints?>
-<?import javafx.scene.layout.GridPane?>
-<?import javafx.scene.layout.HBox?>
 <?import javafx.scene.layout.Pane?>
-<?import javafx.scene.layout.RowConstraints?>
-<?import javafx.scene.layout.VBox?>
-<?import javafx.scene.paint.Color?>
 <?import javafx.scene.text.Font?>
+<?import javafx.scene.text.TextFlow?>
 
-<VBox prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.Controller">
-  <children>
-    <MenuBar style="-fx-background-color: #121212;" VBox.vgrow="NEVER">
-      <menus>
-        <Menu mnemonicParsing="false" text="File">
-          <items>
-            <MenuItem fx:id="menuNew" mnemonicParsing="false" onAction="#loadPosters" text="New" />
-            <MenuItem mnemonicParsing="false" text="Open…" />
-            <Menu mnemonicParsing="false" text="Open Recent" />
-            <SeparatorMenuItem mnemonicParsing="false" />
-            <MenuItem mnemonicParsing="false" text="Close" />
-            <MenuItem mnemonicParsing="false" text="Save" />
-            <MenuItem mnemonicParsing="false" text="Save As…" />
-            <MenuItem mnemonicParsing="false" text="Revert" />
-            <SeparatorMenuItem mnemonicParsing="false" />
-            <MenuItem mnemonicParsing="false" text="Preferences…" />
-            <SeparatorMenuItem mnemonicParsing="false" />
-            <MenuItem mnemonicParsing="false" text="Quit" />
-          </items>
-        </Menu>
-        <Menu mnemonicParsing="false" text="Edit">
-          <items>
-            <MenuItem mnemonicParsing="false" text="Undo" />
-            <MenuItem mnemonicParsing="false" text="Redo" />
-            <SeparatorMenuItem mnemonicParsing="false" />
-            <MenuItem mnemonicParsing="false" text="Cut" />
-            <MenuItem mnemonicParsing="false" text="Copy" />
-            <MenuItem mnemonicParsing="false" text="Paste" />
-            <MenuItem mnemonicParsing="false" text="Delete" />
-            <SeparatorMenuItem mnemonicParsing="false" />
-            <MenuItem mnemonicParsing="false" text="Select All" />
-            <MenuItem mnemonicParsing="false" text="Unselect All" />
-          </items>
-        </Menu>
-        <Menu mnemonicParsing="false" text="Help">
-          <items>
-            <MenuItem mnemonicParsing="false" text="About MyHelloApp" />
-          </items>
-        </Menu>
-      </menus>
-    </MenuBar>
-    <SplitPane dividerPositions="0.2516703786191537, 0.8897550111358574" focusTraversable="true" prefHeight="-1.0" prefWidth="-1.0" style="-fx-background-color: #121212; -fx-box-border: transparent;" VBox.vgrow="ALWAYS">
-      <items>
-        <AnchorPane fx:id="filterPane" minWidth="0.0" prefHeight="551.0" prefWidth="194.0" scaleShape="false" style="-fx-background-color: #212121;" SplitPane.resizableWithParent="false">
-               <children>
-            <Label alignment="CENTER" layoutX="12.0" layoutY="14.0" minWidth="60.0" prefWidth="-1.0" style="&#10;" text="Filter" textAlignment="CENTER" wrapText="false">
-              <font>
-                <Font size="18.0" fx:id="x1" />
-              </font>
-              <textFill>
-                <Color red="0.624" green="0.624" blue="0.624" fx:id="x2" />
-              </textFill>
-            </Label>
-                  <GridPane fx:id="moviesGrid" alignment="CENTER" layoutX="-34.0" layoutY="120.0" prefHeight="191.0" prefWidth="224.0" style="-fx-background-color: #303030;">
-                    <columnConstraints>
-                        <ColumnConstraints hgrow="SOMETIMES" maxWidth="108.0" minWidth="10.0" prefWidth="104.0" />
-                        <ColumnConstraints hgrow="SOMETIMES" maxWidth="108.0" minWidth="10.0" prefWidth="104.0" />
-                      <ColumnConstraints hgrow="SOMETIMES" maxWidth="108.0" minWidth="10.0" prefWidth="104.0" />
-                      <ColumnConstraints hgrow="SOMETIMES" maxWidth="107.0" minWidth="10.0" prefWidth="96.0" />
-                    </columnConstraints>
-                    <rowConstraints>
-                        <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
-                      <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
-                      <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
-                      <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
-                    </rowConstraints>
-                  </GridPane>
-               </children>
-        </AnchorPane>
-        <ScrollPane style="-fx-background-color: #212121;">
-          <content>
-            <AnchorPane id="Content" fx:id="moviesPane" minHeight="-1.0" minWidth="0.0" prefWidth="0.0" style="-fx-background-color: #212121;">
-              <children>
-                <Label alignment="CENTER" layoutX="14.0" layoutY="14.0" style="&#10;" text="Browser" textAlignment="CENTER" wrapText="false">
-                           <textFill>
-                              <Color red="0.624" green="0.624" blue="0.624" fx:id="x5" />
-                           </textFill>
-                           <font>
-                              <Font size="18.0" fx:id="x6" />
-                           </font>
-                        </Label>
-              </children>
-            </AnchorPane>
-          </content>
-        </ScrollPane>
-        <AnchorPane fx:id="detailsPanel" minWidth="0.0" prefWidth="0.0" style="-fx-background-color: #212121;" SplitPane.resizableWithParent="false">
-          <children>
-            <Label alignment="CENTER" font="$x1" layoutX="7.0" layoutY="14.0" style="&#10;" text="Details" textAlignment="CENTER" textFill="$x2" wrapText="false" />
-          </children>
-        </AnchorPane>
-      </items>
-    </SplitPane>
-    <HBox id="HBox" alignment="CENTER_LEFT" spacing="5.0" style="-fx-background-color: #121212;" VBox.vgrow="NEVER">
-      <children>
-        <Label maxHeight="1.7976931348623157E308" maxWidth="-1.0" style="-fx-background-color: #121212;" text="Logged as Guest" HBox.hgrow="ALWAYS">
-          <font>
-            <Font size="11.0" fx:id="x3" />
-          </font>
-          <textFill>
-            <Color red="0.625" green="0.625" blue="0.625" fx:id="x4" />
-          </textFill>
-        </Label>
-        <Pane prefHeight="-1.0" prefWidth="-1.0" style="-fx-background-color: #121212;" HBox.hgrow="ALWAYS" />
-        <Label font="$x3" maxWidth="-1.0" style="-fx-background-color: #121212;" text="Log in" textFill="$x4" HBox.hgrow="NEVER" />
-      </children>
-      <padding>
-        <Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
-      </padding>
-    </HBox>
-  </children>
-</VBox>
+<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="175.0" prefWidth="250.0" style="-fx-background-color: #121212;" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.Controller">
+   <children>
+      <Label layoutX="14.0" layoutY="14.0" text="Log in" textFill="#9f9f9f">
+         <font>
+            <Font size="24.0" />
+         </font>
+      </Label>
+      <TextField fx:id="userTextBox" layoutX="80.0" layoutY="49.0" style="-fx-background-color: #121212; -fx-text-fill: #9f9f9f;" />
+      <TextField fx:id="passTextBox" layoutX="80.0" layoutY="92.0" style="-fx-background-color: #121212; -fx-text-fill: #9f9f9f;" />
+      <Label layoutX="14.0" layoutY="55.0" text="Username" textFill="#9f9f9f">
+         <font>
+            <Font size="14.0" />
+         </font></Label>
+      <Label layoutX="14.0" layoutY="96.0" text="Password" textFill="#9f9f9f">
+         <font>
+            <Font size="14.0" />
+         </font></Label>
+      <Button fx:id="logInButton2" layoutX="190.0" layoutY="141.0" mnemonicParsing="false" onMouseClicked="#closeLoginForm" style="-fx-background-color: #9f9f9f;" text="Sign in" AnchorPane.bottomAnchor="15.0" AnchorPane.rightAnchor="15.0" />
+      <Pane layoutX="80.0" layoutY="75.0" prefHeight="3.0" prefWidth="149.0" style="-fx-background-color: #9f9f9f;" />
+      <Pane layoutX="80.0" layoutY="117.0" prefHeight="3.0" prefWidth="149.0" style="-fx-background-color: #9f9f9f;" />
+      <TextFlow fx:id="errorTextBox" layoutX="14.0" layoutY="134.0" prefHeight="25.0" prefWidth="159.0" />
+   </children>
+</AnchorPane>

+ 2 - 2
src/com/moviesdb/test2.fxml

@@ -151,7 +151,7 @@
     </SplitPane>
     <HBox id="HBox" alignment="CENTER_LEFT" spacing="5.0" VBox.vgrow="NEVER">
       <children>
-        <Label maxHeight="1.7976931348623157E308" maxWidth="-1.0" style="-fx-background-color: #121212;" text="Logged in as Guest" HBox.hgrow="ALWAYS">
+        <Label fx:id="userLabel" maxHeight="1.7976931348623157E308" maxWidth="-1.0" style="-fx-background-color: #121212;" text="Logged in as Guest" HBox.hgrow="ALWAYS">
           <font>
             <Font size="11.0" fx:id="x3" />
           </font>
@@ -160,7 +160,7 @@
           </textFill>
         </Label>
         <Pane prefHeight="-1.0" prefWidth="-1.0" style="-fx-background-color: #121212;" HBox.hgrow="ALWAYS" />
-        <Label fx:id="logInButton" font="$x3" maxWidth="-1.0" style="-fx-background-color: #121212;" text="Log in" textFill="$x4" HBox.hgrow="NEVER" />
+        <Label fx:id="logInButton" font="$x3" maxWidth="-1.0" onMouseClicked="#openLoginForm" style="-fx-background-color: #121212;" text="Log in" textFill="$x4" HBox.hgrow="NEVER" />
       </children>
       <padding>
         <Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />