0

An accordion in my GUI application has quite a few FXML controllers (each controls a single TitledPane). Within the appplication, these controllers need to talk to each other (and I've got that working). But now I want to have something a little more elegant and lean more about JavaxFX in the process. So instead of this:

ToolbarViewController toolbarController;
DesignAreaController designController;
...
public void setToolbarController(ToolbarViewController toolbarController){
    this.toolbarController = toolbarController;       
}

etc. for each controller, is there a way of doing this with one method call? Something like:

public void setController(String id??, ???Controller controller){
    listOfControllers.getControllerById().setController(controller);
} // This makes no sense of course but illustrates my question
Frank
  • 521
  • 7
  • 19
  • Can you check this out? This might help http://stackoverflow.com/questions/22178533/communication-beetween-two-javafx-controllers – Francis Fredrick Valero Aug 16 '15 at 02:35
  • I have thank you, but that's mostly about communicating between controllers and that bit works fine for me. – Frank Aug 16 '15 at 02:40
  • 1
    Perhaps having all the controllers have references to each other is the real issue. Typically, they should all have access to a shared model and access the data in the model. – James_D Aug 16 '15 at 11:44

0 Answers0