JavaFX refetch observablelist from database
I need to show a custom made list of nodes from a database table that is frequently updated from external sources.
When changes are made to the database, the list needs to be updated on the screen accordingly.
For this I have implemented an ObservableList with an onChanged method that should check for changes and rebuild the custom list.
I my case the onChanged method will never fire when n开发者_开发技巧ew data is added in the database, only when changes are made on the fly to the already defined ObservableList.
How can i let the ObservableList know when new data exists in the database ?
Thanks in advance!
Given your answer to jkaufmann it seems you need to change your logic.
Instead of rebuilding ObservableList each time you need to calculate the difference with new data and update ObservableList with new/removed data.
精彩评论