I am using javafx table view control to display my table data. Now the data is quite huge and when I show the full data in the control it crashes. Is there any way to do so or will I have to cache the data so that I can display it in chunks. Should I use JTable instead ?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
I'm not quite sure if I understand your question right, but what about lazy loading of the items? Actually there is an example within the Docs directly. Though it is for the TreeView and not for the TableView, you should be able to simply adapt the idea behind.
Hope that helps, at least for my TreeView, it solved a lot of problems so far.
Cheers, Regine
I made a lazy-load on tableview using the CellFactory class... I´ll try to explain, anyone with better english than mine fell free to edit and make it more understandable!
First I use a mandatory property in a Bean to check if that bean has already been loaded or not. This way I don't need to create an attribute specifically for that.
Second, I loaded into TableView my Bean collection just with the 'id' property loaded, what makes my table display all in blank.
At last, I create a CellFactory, like this one below, to check if object has loaded or not, and if not do it now.
In the method loadPersonBean I pass the object contained in TableView Collection and load it from DataBase. Than I COPY all the needed data to the bean received from the table. I didn't try to swap the object in TableView, but I believe it may result a Concurrent Exception.
Other observation: In all my tests TableView always respects the column order to call my CellFactory, but I did not test if it still respects the order if user swap the column order. So I prefer to add a CellFactory with the "LazyLoadCheck" part of code to all columns.
Hope I made my self clear enough to help! If any questions remains, comment and I'll try to do a better explanation.