From f2c5b00ab03ef2d80af81cdde799fa5ba2922fbc Mon Sep 17 00:00:00 2001 From: Goh Li Ting Date: Fri, 22 Sep 2023 23:29:08 +0800 Subject: [PATCH] Change ExitCommand to close the application --- src/main/java/chatbuddy/command/ExitCommand.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/chatbuddy/command/ExitCommand.java b/src/main/java/chatbuddy/command/ExitCommand.java index 92542e3367..a527505720 100644 --- a/src/main/java/chatbuddy/command/ExitCommand.java +++ b/src/main/java/chatbuddy/command/ExitCommand.java @@ -4,6 +4,7 @@ import chatbuddy.TaskList; import chatbuddy.storage.Storage; import chatbuddy.ui.Ui; +import javafx.application.Platform; /** ExitCommand represents a command to exit the chatbot. */ public class ExitCommand extends Command { @@ -13,6 +14,7 @@ public class ExitCommand extends Command { @Override public String execute(TaskList tasks, Ui ui, Storage storage) throws ChatBuddyException { storage.save(tasks); + Platform.exit(); return ui.showExit(); } }