From 996940977c144a18a9da5bc83a52b628228e7387 Mon Sep 17 00:00:00 2001 From: JiaXinEu Date: Fri, 5 Jul 2024 15:28:05 +0800 Subject: [PATCH] Add possible solutions to fix text overrun --- tutorials/javaFxPart4.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tutorials/javaFxPart4.md b/tutorials/javaFxPart4.md index 1580ffe9..973d5225 100644 --- a/tutorials/javaFxPart4.md +++ b/tutorials/javaFxPart4.md @@ -109,6 +109,28 @@ We will get to that later. ![Settings for DialogBox](images/javafx/DialogBoxController.png) + + + Using the FXML files above, text overrun may occur when the text to be displayed exceeds the size of the label, causing the text to not be fully displayed and ending with `...` instead. + + To fix this issue, we can implement one of the suggested changes below to the FXML files: + + 1. Changing MainWindow.fxml + + Remove `prefHeight` for `VBox`: + ```xml + + ``` + + 2. Changing DialogBox.fxml + + Set `minHeight` for `Label`: + ```xml + + ## Using Controllers As part of the effort to separate the code handling Duke's logic and UI, let's _refactor_ the UI-related code to its own class.