I\'m tryin to build a skeleton for a big complex gui, so the idea is to make everything with mvc like style in javafx 2.1, so every component has a fxml file and if needed css,c
Don't just include fxml, create a business logic layer for that:
<BorderPane xmlns:fx="http://javafx.com/fxml">
<center>
<Pane fx:id="content"/>
</center>
and update it in button click handlers:
@FXML
private void handleTaskBarButton2Action(ActionEvent event) {
System.out.println("click! taskBarButton2");
content.getChildren().clear();
content.getChildren().add(FXMLLoader.load(getClass().getResource("Content2.fxml"));
}
it works,thx for help, but i was forced to remove TaskBar.fxml and TaskBarController.java , wrote a MainViewController with @FXML handles and @FXML for the Buttons and the Pane with the fx:id="content" , and put my customs Buttons in MainView.fxml
@FXML
private void handleTaskBarButton2Action(ActionEvent event) throws IOException {
System.out.println("click! taskBarButton2");
content.getChildren().clear();
content.getChildren().add((Node) FXMLLoader.load(getClass().getResource("Content2.fxml")));
}