I recently started programming an application with JavaFX (jdk 1.8.0_66). I got a few table(view)s, one of them should be an overview about all the 'subscription'-objects. Therefore I create the tableview and populate it with an observable list:
TableView subsTable = new TableView(SubscriptionAdmin.getObservableSubList());
My table for example kinda looks like this:
Subscription | Participants
Netflix | 4
Whatever | 8
TableColumn<Subscription,String> nameCol = new TableColumn("Subscription");
nameCol.setCellValueFactory(new PropertyValueFactory("name"));
TableColumn<Subscription, Integer> partCol = new TableColumn("Participants");
partCol.setCellValueFactory(
cellData -> new ReadOnlyObjectWrapper<>(cellData.getValue().getParticipants().size())
);
Now whenever I add an participant to my list, the number in the according cell should be increased by one but it won't - except I restart the application. Hope someone of you can help me / explain me what's the problem.