1<?xml version="1.0" encoding="UTF-8"?>
2
3<?import javafx.scene.text.*?>
4<?import java.lang.*?>
5<?import javafx.scene.*?>
6<?import javafx.scene.control.*?>
7<?import javafx.scene.layout.*?>
8
9
10<VBox xmlns:fx="http://javafx.com/fxml/1" prefHeight="300.0" prefWidth="300.0" xmlns="http://javafx.com/javafx/8">
11 <children>
12 <fx:define>
13 <String fx:value="My radio group" fx:id="text" />
14 </fx:define>
15 <Text>
16 <text>
17 <!-- reference text defined above using fx:reference -->
18 <fx:reference source="text"/>
19 </text>
20 </Text>
21 <RadioButton text="Radio 1">
22 <toggleGroup>
23 <ToggleGroup fx:id="group" />
24 </toggleGroup>
25 </RadioButton>
26 <RadioButton text="Radio 2">
27 <toggleGroup>
28 <!-- reference ToggleGroup created for last RadioButton -->
29 <fx:reference source="group"/>
30 </toggleGroup>
31 </RadioButton>
32 <RadioButton text="Radio 3" toggleGroup="$group" />
33
34 <!-- reference text defined above using expression binding -->
35 <Text text="$text" />
36 </children>
37</VBox>
38