diff --git a/src/main/java/no/ntnu/idatt1002/demo/controller/BudgetController.java b/src/main/java/no/ntnu/idatt1002/demo/controller/BudgetController.java index 8c2469899488c3e184f24f40e81a8e7ff385ffec..a638dcf356a695d16d3cc7c68a92055c9ed3fcb3 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/controller/BudgetController.java +++ b/src/main/java/no/ntnu/idatt1002/demo/controller/BudgetController.java @@ -266,9 +266,8 @@ public class BudgetController implements FinanceController { } /** - * Switches scenes from the budget scene to another, by loading a new FXML file and setting the scene to this location. - * The destination depends entirely on which button is pressed. - * @param event A button click on the buttons on the buttonbar or the next button + * Switches scenes back to main menu, by loading a new FXML file and setting the scene to this location. + * @param event A button click on the return to main menu button * @throws IOException If an error occurs with loading any of the FXML files. */ @FXML diff --git a/src/main/java/no/ntnu/idatt1002/demo/controller/FinanceController.java b/src/main/java/no/ntnu/idatt1002/demo/controller/FinanceController.java index 96efb6519e3b2e44ce77d43580ecf8e48e9524dd..09b609371ec64d1bad41ef3fe070846f2a1edc17 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/controller/FinanceController.java +++ b/src/main/java/no/ntnu/idatt1002/demo/controller/FinanceController.java @@ -49,4 +49,11 @@ public interface FinanceController { * @throws IOException If an error occurs while writing to the file. */ void saveDataToFile() throws IOException; + + /** + * Switches scenes back to main menu, by loading a new FXML file and setting the scene to this location. + * @param event A button click on the return to main menu button + * @throws IOException If an error occurs with loading any of the FXML files. + */ + void returnToMainMenu(javafx.event.ActionEvent event) throws IOException; } diff --git a/src/main/java/no/ntnu/idatt1002/demo/controller/IncomeExpenseController.java b/src/main/java/no/ntnu/idatt1002/demo/controller/IncomeExpenseController.java index 5e5760a068ee7650d75bd7241acd97d01ec5efc3..ae01c334d84dee51300ae2dbd365673b541420e3 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/controller/IncomeExpenseController.java +++ b/src/main/java/no/ntnu/idatt1002/demo/controller/IncomeExpenseController.java @@ -517,10 +517,12 @@ public class IncomeExpenseController implements FinanceController { } /** - * Switches the scene to the Main Menu scene. + * Switches scenes back to main menu, by loading a new FXML file and setting the scene to this location. + * @param event A button click on the return to main menu button + * @throws IOException If an error occurs with loading any of the FXML files. */ @FXML - private void returnToMainMenu(javafx.event.ActionEvent event) throws IOException { + public void returnToMainMenu(javafx.event.ActionEvent event) throws IOException { saveDataToFile(); FXMLLoader loader = new FXMLLoader(); loader.setLocation(getClass().getResource("/view/MainMenuNew.fxml"));