What's the proper way to populate a ListView with a huge number of items?
ytwApr 10 2012 — edited Apr 10 2012Hello,
I followed the "List of Color Patterns" example on this page (http://docs.oracle.com/javafx/2.0/ui_controls/list-view.htm#CEGGEDBF) and it worked well.
I modified the code and every time the ObservableList<String> is changed (i.e. add or remove an item), the "Observer" (ListView) is updated immediately.
For my application, I need to add a huge number of items to the ObservableList. For efficiency reasons and better UI responsiveness, I'm thinking I should use a different thread to populate the ObservableList and some how control how often the Observer updates itself.
My questions are:
#1. Is this the right approach? If not, what's the proper way to handle this situation?
#2. How to control the frequency that the Observer updates itself?
Thanks.