From bebac0712bc3d63e645e89a533e45c502de04fde Mon Sep 17 00:00:00 2001
From: Harry Linrui XU <xulr0820@hotmail.com>
Date: Thu, 20 Apr 2023 00:08:56 +0200
Subject: [PATCH] Fixed visual bug in error message

---
 .../demo/controller/CreateBudgetController.java        |  2 +-
 src/main/resources/view/CreateBudget.fxml              | 10 +++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/main/java/no/ntnu/idatt1002/demo/controller/CreateBudgetController.java b/src/main/java/no/ntnu/idatt1002/demo/controller/CreateBudgetController.java
index ebe6bace..e061094c 100644
--- a/src/main/java/no/ntnu/idatt1002/demo/controller/CreateBudgetController.java
+++ b/src/main/java/no/ntnu/idatt1002/demo/controller/CreateBudgetController.java
@@ -62,7 +62,7 @@ public class CreateBudgetController {
 
     if(!createNewFiles(budgetName)) {
       updateCurrentFile("", "");
-      errorMsg.setText("A budget of the same \nname already exists");
+      errorMsg.setText("A budget of the same name already exists");
       errorMsg.setOpacity(1);
       return;
     }
diff --git a/src/main/resources/view/CreateBudget.fxml b/src/main/resources/view/CreateBudget.fxml
index adfe27dc..6d9dafaa 100644
--- a/src/main/resources/view/CreateBudget.fxml
+++ b/src/main/resources/view/CreateBudget.fxml
@@ -11,9 +11,10 @@
 <?import javafx.scene.layout.Pane?>
 <?import javafx.scene.layout.RowConstraints?>
 <?import javafx.scene.layout.VBox?>
+<?import javafx.scene.text.Font?>
 <?import javafx.scene.text.Text?>
 
-<DialogPane prefHeight="225.0" prefWidth="240.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.controller.CreateBudgetController">
+<DialogPane prefHeight="113.0" prefWidth="327.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.controller.CreateBudgetController">
    <content>
       <VBox>
          <children>
@@ -32,7 +33,7 @@
                   <Label text="Name: " GridPane.rowIndex="1" />
                </children>
             </GridPane>
-            <Label fx:id="errorMsg" alignment="CENTER_RIGHT" opacity="0.0" text="Please fill in the name" textFill="RED" />
+            <Label fx:id="errorMsg" alignment="CENTER_RIGHT" opacity="0.0" prefHeight="315.0" prefWidth="315.0" text="Please fill in the name field" textAlignment="CENTER" textFill="RED" />
             <HBox alignment="CENTER_RIGHT" prefHeight="100.0" prefWidth="200.0" spacing="5.0">
                <children>
                   <Button fx:id="cancelBtn" mnemonicParsing="false" onAction="#pressCancelBtn" prefWidth="70.0" text="Cancel" />
@@ -48,7 +49,10 @@
    <header>
       <Pane prefHeight="40.0">
          <children>
-            <Text layoutX="12.0" layoutY="25.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Please type the name of your budget" />
+            <Text layoutX="12.0" layoutY="25.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Please type the name of your budget">
+               <font>
+                  <Font name="Lucida Console" size="14.0" />
+               </font></Text>
          </children>
       </Pane>
    </header>
-- 
GitLab