JavaFX TabPane – One controller for each tab
One approach is to encapsulate each of your tab pages into a separate FXML file with it’s own associated controller class. Then in your FXML file for the main tab control you can do something like this: <TabPane fx:controller=”com.foo.MainController”> <tabs> <Tab text=”Untitled Tab 1″> <content> <fx:include fx:id=”fooTabPage” source=”fooTabPage.fxml”/> </content> </Tab> <Tab text=”Untitled Tab 2″> <content> … Read more