diff --git a/tutorials/images/javafx/NoOverrunDialogBox.png b/tutorials/images/javafx/NoOverrunDialogBox.png new file mode 100644 index 00000000..90dafc8a Binary files /dev/null and b/tutorials/images/javafx/NoOverrunDialogBox.png differ diff --git a/tutorials/images/javafx/OverrunDialogBox.png b/tutorials/images/javafx/OverrunDialogBox.png new file mode 100644 index 00000000..a3c4dc09 Binary files /dev/null and b/tutorials/images/javafx/OverrunDialogBox.png differ diff --git a/tutorials/javaFxPart4.md b/tutorials/javaFxPart4.md index 1580ffe9..aa8338fa 100644 --- a/tutorials/javaFxPart4.md +++ b/tutorials/javaFxPart4.md @@ -81,7 +81,7 @@ Note that if you are using packages, `fx:controller="MainWindow"` needs to be up - @@ -89,6 +89,17 @@ Note that if you are using packages, `fx:controller="MainWindow"` needs to be up ``` + + +Note that for `Label`, we set `wrapText` to **true** and `minHeight` to **-Infinity**. This configuration wraps the text within the label, removes the minimum height constraint, and allows the label to grow vertically as needed. + +![Set minHeight for Label](images/javafx/NoOverrunDialogBox.png) + +Without setting `minHeight` to **-Infinity**, 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. + +![No minHeight for Label](images/javafx/OverrunDialogBox.png) + + 1. Let’s explore the provided FXML files in Scene Builder.