To preload images:
img = Document.get().createImageElement()
img.setSrc(url)
(you could then keep all those ImageElementâ‹…s in a list and use them
directly instead of setHTML)
You can use Image widgets too, which have load event handlers.
On Wednesday, February 15, 2017 at 1:33:37 PM UTC+1, Jonathan Cook wrote:
>
> I tried with a timer but the transition is a little slow the first time as
> the images download. Is there some way to cache or download them into
> memory before iterating them?
> // Create a new timer that iterates the images
> Timer t = new Timer() {
> int counter = 0;
>
> @Override
> public void run() {
> if (counter < imageUrls.size()) {
> iconPreviewHTML.setHTML("<img src=\"" + imageUrls.
> get(counter) + "\"/>");
> }
> counter++;
> }
> };
> // Schedule the timer to run once in x seconds.
> t.scheduleRepeating(500);
>
>
>
>
--
You received this message because you are subscribed to the Google Groups "GWT
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.