Skip to content

Commit

Permalink
javaFxPart4.md: Explain fx:root
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaXinEu authored Jul 26, 2024
1 parent 7fafaf8 commit 40c1323
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tutorials/javaFxPart4.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ We will get to that later.
![Controller for MainWindow](images/javafx/MainWindowController.png)

1. Let’s repeat the process for `DialogBox`.
The main difference here is that DialogBox checks `Use fx:root construct` and _does not define a controller class_.
The main difference here is that DialogBox ticks `Use fx:root construct` and _does not define a controller class_. Ticking this enables the use of the `fx:root` element, allowing you to reference a root element predefined by calling the `setRoot()` method. The controller can be programatically set using the `setController()` method.

More about `fx:root` on the documentation [Introduction to FXML | JavaFX 2.2](https://docs.oracle.com/javafx/2/api/javafx/fxml/doc-files/introduction_to_fxml.html#root_elements).

![Settings for DialogBox](images/javafx/DialogBoxController.png)

Expand Down

0 comments on commit 40c1323

Please sign in to comment.