Good day. Tell me please. There is a huge table with 10,000,000 entries or more. How can I make her withdrawal in groups of 500,000 each and so that the rest is loaded sequentially. This is due to the fact that when outputting all the records at once, the program thinks for a very long time. Which way to dig? thank
1 answer
The implementation itself will not tell, but the ideas may be as follows.
You can first put down the first N records, then via Platform.runLater (), load the rest of the records (not optimal, because there will be no need to load the records).
You can subscribe to
scrollevents ( scrollFinish , for example), and inside the handler, see whether it is worth loading new entries. If it is, then also via Platform.runLater () to load records.Redefine your custom skin for the TableView (must inherit from TableViewSkin ), in which you take the flow class field ( VirtualFlow class instance ), take the index of the last visible line from it (
flow.getFirstVisibleCell().getIndex()) and see if this line is the last in the table (the index of the last visible row is equal to the size of the table -1), then also load the following rows.