From 4e41de6106530b6d633d39fe128820d83dada8d3 Mon Sep 17 00:00:00 2001 From: logical-1985516 Date: Sat, 24 Feb 2024 23:49:35 +0800 Subject: [PATCH] Display welcome message upon load --- src/main/java/luke/MainWindow.java | 3 +++ src/main/java/luke/Ui.java | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/java/luke/MainWindow.java b/src/main/java/luke/MainWindow.java index 84391b3cff..f374b2cd73 100644 --- a/src/main/java/luke/MainWindow.java +++ b/src/main/java/luke/MainWindow.java @@ -32,6 +32,9 @@ public class MainWindow extends AnchorPane { @FXML public void initialize() { scrollPane.vvalueProperty().bind(dialogContainer.heightProperty()); + String welcomeMessage = "Hello! I'm Luke!\n" + + "What can I do for you?\n"; + dialogContainer.getChildren().add(DialogBox.getDukeDialog(welcomeMessage, dukeImage)); } public void setDuke(Luke d) { diff --git a/src/main/java/luke/Ui.java b/src/main/java/luke/Ui.java index dafa0cc02b..8679121a06 100644 --- a/src/main/java/luke/Ui.java +++ b/src/main/java/luke/Ui.java @@ -6,15 +6,6 @@ * In charge of printing statements, to confirm to the user that the action is completed. */ public class Ui { - /** - * Returns the welcome message. - * @return The welcome message. - */ - public String displayWelcome() { - return "Hello! I'm Luke!\n" - + "What can I do for you?\n"; - } - /** * Returns the goodbye message. * @return The goodbye message.