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

Shortened error messages in alert box

parent 869d8d69
No related branches found
No related tags found
3 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
Pipeline #215833 passed
......@@ -252,8 +252,7 @@ public class IncomeExpenseController implements FinanceController {
* @param event A button click on the edit button.
*/
@Override
public void handleEditBtn(javafx.event.ActionEvent event) {
System.out.println(event.getSource());
public void handleEditBtn(javafx.event.ActionEvent event) {
Income chosenIncome = incomeTableView.getSelectionModel().getSelectedItem();
Expense chosenExpense = expenseTableView.getSelectionModel().getSelectedItem();
......@@ -265,9 +264,6 @@ public class IncomeExpenseController implements FinanceController {
boolean isDeleteExpense = event.getSource() == deleteExpenseMenu;
System.out.println(chosenIncome);
System.out.println(chosenExpense);
if (isEditIncome) {
handleEditIncome(chosenIncome);
} else if (isDeleteIncome) {
......@@ -333,8 +329,8 @@ public class IncomeExpenseController implements FinanceController {
// Set the Dialog's content to the loaded FXML file
dialog.getDialogPane().setContent(loader.load());
} catch (IOException e) {
showErrorDialogBox("Loading", "Error in loading dialog box", "An error occurred"
+ "while loading AddIncome window");
showErrorDialogBox("Loading", "Error in loading dialog box", "Could not load"
+ "the AddIncome window");
}
// Get the controller for the loaded FXML file
......@@ -369,8 +365,8 @@ public class IncomeExpenseController implements FinanceController {
// Set the Dialog's content to the loaded FXML file
dialog.getDialogPane().setContent(loader.load());
} catch (IOException e) {
showErrorDialogBox("Loading", "Error in loading dialog box", "An error occurred"
+ "while loading AddExpense window");
showErrorDialogBox("Loading", "Error in loading dialog box", "Could not load"
+ "the AddExpense window");
}
// Get the controller for the loaded FXML file
......@@ -407,8 +403,8 @@ public class IncomeExpenseController implements FinanceController {
// Set the Dialog's content to the loaded FXML file
dialog.getDialogPane().setContent(loader.load());
} catch (IOException e) {
showErrorDialogBox("Loading", "Error in loading dialog box", "An error occurred"
+ "while loading EditIncome window");
showErrorDialogBox("Loading", "Error in loading dialog box", "Could not load"
+ "the EditIncome window");
}
// Get the controller for the loaded FXML file
......@@ -439,8 +435,8 @@ public class IncomeExpenseController implements FinanceController {
// Set the Dialog's content to the loaded FXML file
dialog.getDialogPane().setContent(loader.load());
} catch (IOException e) {
showErrorDialogBox("Loading", "Error in loading dialog box", "An error occurred"
+ "while loading EditExpense window");
showErrorDialogBox("Loading", "Error in loading dialog box", "Could not"
+ "load the EditExpense window");
}
// Get the controller for the loaded FXML file
......@@ -531,8 +527,8 @@ public class IncomeExpenseController implements FinanceController {
incomeRegister = fileHandling.readIncomeRegisterFromFile(fileName);
}
} catch (IOException ioe) {
showErrorDialogBox("File reading error", "Error in reading from file", "An error occurred"
+ "while reading the IncomeRegister from file");
showErrorDialogBox("File reading error", "Error in reading from file", "Could not"
+ "read the IncomeRegister from file");
}
return incomeRegister;
}
......@@ -551,8 +547,8 @@ public class IncomeExpenseController implements FinanceController {
expenseRegister = fileHandling.readExpenseRegisterFromFile(fileName);
}
} catch (IOException ioe) {
showErrorDialogBox("File reading error", "Error in reading from file", "An error occurred"
+ "while reading the ExpenseRegister from file");
showErrorDialogBox("File reading error", "Error in reading from file", "Could not"
+ "read the ExpenseRegister from file");
}
return expenseRegister;
}
......@@ -572,8 +568,8 @@ public class IncomeExpenseController implements FinanceController {
generalBudget = fileHandlingBudget.readGeneralBudgetFromFile(fileName);
}
} catch (IOException ioe) {
showErrorDialogBox("File reading error", "Error in reading from file", "An error occurred"
+ "while reading the GeneralBudget from file");
showErrorDialogBox("File reading error", "Error in reading from file", "Could not"
+ "read the GeneralBudget from file");
}
return generalBudget;
}
......@@ -595,8 +591,8 @@ public class IncomeExpenseController implements FinanceController {
stage.setScene(scene);
stage.show();
} catch(IOException ioe) {
showErrorDialogBox("Loading error", "Error in loading", "An error occurred"
+ "while saving saving to file and loading next window");
showErrorDialogBox("Loading error", "Error in loading", "Could not save"
+ "to file");
}
}
......
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