Хочу сделать приложение, содержащие несколько окон, с возможностью переключения между окнами. Создал два fxml файла.
Window1
<AnchorPane id="AnchorPane" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ru.ui.Window1">
<children>
<Button layoutX="126" layoutY="90" text="Click Me!" onAction="#goToWindow2" fx:id="button" />
</children>
</AnchorPane>
Window2
<AnchorPane id="AnchorPane" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ru.ui.Window2">
<children>
<Button layoutX="126" layoutY="90" text="Click Me!" onAction="#closeWindow2" fx:id="button" />
</children>
</AnchorPane>
Делал простой пример с одним окном. Там все просто: один контроллер и один fxml файл. А как сделать выше поставленную задачу, понять не могу. Подскажите, пожалуйста. Заранее благодарен.