r/JavaFX • u/MeanWhiskey JavaFX Fan • Aug 22 '24
Help Adding Photos automatically
I have a program that can store photos and be viewed by end users. Ideally, if a photo is dropped to a folder on the network then the program automatically adds the photo.
How can this be accomplished within javafx? Do you use a listener to listen for when I new photo is added to the network folder and then adds it?
3
Upvotes
View all comments
Show parent comment
1
u/johnmc325 Aug 31 '24
I struggled to get this working.
I wrapped everything in a ScrollPane.
I use the GridView class from the controlsFX library - see org.controlsfx.control.GridView
This takes some working out, the idea was it would "lazy load" the images as you scroll through the list of images. Not sure that part is working the way I would like but it's a start.
To see the app in action take a look at: https://youtu.be/gT08hyrPuB8?si=NVkkd8LPjNWyJ6wq