I want to populate the main window's listview whilst the child modal window is in focus. I'm getting a non-static method cannot be referenced from a static context error.
I have this so far...
EDIT: Made methods static, now have null-pointer exception. The array APPLICABLE_CLAUSES definitely has contents.
-----------------NewProject.java child modal window---------------
@FXML protected void createNewProject(ActionEvent event) {
//other code
MainController.displayApplicableClauses();//ERROR OCCURS HERE
}
----------MainController.java parent window-------------
public class MainController {
@FXML private static ListView addListView;
public static void displayApplicableClauses() {
// Populate the ListView.
addListView.setItems(FXCollections.observableArrayList(APPLICABLE_CLAUSES));
}
}