Help with only loading visible images in gridview

31 views
Skip to first unread message

angry bacteria

unread,
May 24, 2022, 6:22:01 PM5/24/22
to ControlsFX
Hei there

So I have the following problem. I have around 1500 images of playing cards. I want to display them in a "Gallery" where you could scroll through them. I was able to create a GridView with the ImageCell object and I was also able to add images to it. Now my problem is that if I add all Image's at once logically Java crashes because of a heap error. I have the image url's (local files) in a list. How could I implement that it only load lets say 15 images. If I then scroll it loads the next 15 and unloads the old ones. So it would only load the images of the actual visible images and not all 1500. How would I do this? I am completely out of ideas.  

this is my code
https://pastebin.com/EQvxMsjd
Reply all
Reply to author
Forward
0 new messages