Skip to content
Snippets Groups Projects
Commit d71903ea authored by Harry Linrui XU's avatar Harry Linrui XU
Browse files

Added returnToMainMenu method into interface. Added javadoc

parent c0367ca5
No related branches found
No related tags found
5 merge requests!43Merging frontend-testing into master,!38"Made progressbar dynamic in accordance to spending. Added balance field....,!37Made the sub progress bars respond to changes in expense,!32Added input validation to add dialog boxes.,!31Added input validation to tableviews
......@@ -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
......
......@@ -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;
}
......@@ -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"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment