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

Implemented file handling class in the ExpensesController

parent 43da7b5d
No related branches found
No related tags found
10 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.,!30Redesigned scenes,!29Redesigned scenes,!28Redesigned scenes,!26Redesigned Main menu and expense/income windows,!24Merging frontend-testing with master,!23Merging frontend-testing and master
......@@ -23,6 +23,7 @@ import javafx.stage.Stage;
import no.ntnu.idatt1002.demo.data.Economics.Expense;
import no.ntnu.idatt1002.demo.data.Economics.ExpenseCategory;
import no.ntnu.idatt1002.demo.data.Economics.ExpenseRegister;
import no.ntnu.idatt1002.demo.data.Economics.FileHandling;
import no.ntnu.idatt1002.demo.view.ExpenseRepository;
enum DialogMode {
......@@ -73,11 +74,13 @@ public class ExpensesController {
@FXML
public void initialize() {
ObservableList<String> filter = FXCollections.observableArrayList("All", "Other", "Food");
expenses = FXCollections.observableArrayList(expenseRegister.getItems());
show.setItems(filter);
show.setValue("All");
expenses = FXCollections.observableArrayList(expenseRegister.getItems());
dateColumn.setCellValueFactory(new PropertyValueFactory<Expense, String>("date"));
amountColumn.setCellValueFactory(new PropertyValueFactory<Expense, Double>("amount"));
categoryColumn.setCellValueFactory(new PropertyValueFactory<Expense, ExpenseCategory>("category"));
......@@ -153,6 +156,7 @@ public class ExpensesController {
}
public void loadDataFromFile(String fileName) {
FileHandling fileHandling = new FileHandling();
File file = new File(System.getProperty("user.dir") + "/src/main/resources/" + fileName + ".txt");
if (file.length() == 0) {
......
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