I have a TabPane with two Tabs and I want to load another FXML when I click on one Tab
<TabPane fx:id="tabPaneGet" layoutY="-7.0" prefHeight="30.0" prefWidth="560.0" tabClosingPolicy="UNAVAILABLE">
<tabs>
<Tab disable="true" text="Получить сообщение из очереди">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
</content>
</Tab>
<Tab text="Отправить сообщение в очередь" fx:id="tabPaneSendMessage">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
</content>
</Tab>
</tabs>
</TabPane>
Class start Application
public class TestFrame extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
FXMLLoader loader = new FXMLLoader();
URL xmlUrl = getClass().getResource("/Test.fxml");
loader.setLocation(xmlUrl);
Parent root = loader.load();
stage.setTitle("Title");
stage.setScene(new Scene(root));
stage.show();
}
}
Maybe something needs to be added to the controller? And if so, where and what?