Do
budgetsObservable.setAll(wrapper.updateBudget());
문제
I have a TableView (javafx.scene.control.TableView) which I populated with data. This data is retreived from the database as an ArrayList, so I used the folowing flow:
private ObservableList<Budget> budgetsObservable;
private ArrayList<Budget> budgetsArray;
I populate the ArrayList with budget data
budgetsArray= wrapper.findAllBudget();
I initialize the ObservableList with the data array
budgetsObservable = FXCollections.observableArrayList(budgetsArray);
To my TableView (TableView, I add my ObservableList
tableViewBudget.setItems(budgetsObservable);
I update the values in the array
budgetsArray = wrapper.UpdateBudget();
The initial data is shown correctly. I was expecting that by changing the ArrayList(last step), the ObservableList would see the change and pass it to my TableView. What would be the flow in order to make the change in the array result in the TableView being signalled and updated with the new data.
해결책
Do
budgetsObservable.setAll(wrapper.updateBudget());