It should be somewhat simple. There are two main steps.
1.) Create a widget that you can scan to download the image programmatically, rather than automatically displaying it. Save the URL of the image you are uploading and enter a method for downloading it.
public class LazyImage extends Image { private String url;
This can be used just like a regular Image class, except that you will need to call lazyLoad() to get the image.
2.) Detect when an image is needed using the ScrollPanel .
I'm not entirely sure that the code for this does not work, but it basically comes down to comparing the location of the image and the scroll position of the scroll bar. If the scroll position> = the distance to the image from the top of the scroll bar, call lazyLoad() and the image will appear.
I have not tried any of this code, this is just a sketch of what should work. Feel free to ask questions or give feedback if they work / do not work for you.
Jason hall
source share