I am working on adding images to an HBox. After the user chooses the images from their hard drive, they are resized, JPEG-encoded then uploaded to the server.
The problem is that the selected images don't show up in their Image controls in my HBox until several seconds into the process. I want them to show immediately so the user knows it worked, and they can keep going while the app runs the background processes.
I have tried several things, including placing event listeners for when the Image is added to the HBox:
In the listener I have tried invalidateDisplayList, validateNow and invalidateProperties. I have also tried calling these functions in other locations in the code prior to it starting the background processing code.
None of my attempts work. Typically the images show up in the HBox about halfway through the uploading process. (5-20 seconds depending on number of images selected)
I have had other instances where I need to force a redraw/refresh of a certain component while code is running, and I always face a similar problem. Is there any way to prioritize a redraw?