Java Reference
In-Depth Information
Consequently, loading the included FXML file will result in a root element of type VBox , and a controller of type
IncludeExampleDetailController . The controller of the including FXML file, IncludeExampleTreeController
has fields like the following:
@FXML
private VBox details;
@FXML
private IncludeExampleDetailController detailsController;
These fields will hold the loaded root and controller of the included FXML file when the including FXML file
is loaded.
The complete source codes of this section's example are shown in Listings 3-20 to 3-25.
Listing 3-20. IncludeExampleTree.fxml
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TreeTableColumn?>
<?import javafx.scene.control.TreeTableView?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<BorderPane maxHeight="-Infinity"
maxWidth="-Infinity"
minHeight="-Infinity"
minWidth="-Infinity"
prefHeight="400.0"
prefWidth="600.0"
xmlns=" http://javafx.com/javafx/8 "
xmlns:fx=" http://javafx.com/fxml/1 "
fx:controller="IncludeExampleTreeController">
<top>
<Label text="Product Details"
BorderPane.alignment="CENTER">
<font>
<Font name="System Bold Italic" size="36.0"/>
</font>
</Label>
</top>
<left>
<VBox spacing="10.0">
<children>
<Label text="List of Products:">
<font>
<Font name="System Bold" size="12.0"/>
</font>
</Label>
<TreeTableView fx:id="treeTableView"
prefHeight="200.0"
prefWidth="200.0"
Search WWH ::




Custom Search