mardi 30 janvier 2018

What is good practice to change the center pane from different controlles in javafx

I created an app with a BorderPane and want to change the content of the center from different fxml controllers, so I don't want to change the whole scene. I have a RootLayoutController that created the Menu bar and the Header, but I am not sure about the best practice to change the content from outside. Would you suggest a MVC-Pattern or should I try to get the BorderPane by the event. Getting BorderPane by event seems not like a clean solution here, but it's just a feeling. Also creating the controllers as singletons was an idea but it's not working with the instantiation (produces NPEs). Any advice would be great because I am lack off experience.

(No code here because I am asking for a general advice.)

Aucun commentaire:

Enregistrer un commentaire