I don't think LoadListener is broken, it's just that there's a catch in using it. The actual loading of the image doesn't take place if such image is not attached to the document, so if you really want to load it without the user seeing the actual load, you have to use a trick like loading it in a hidden part of the document:
//get the size of the window int width = Window.getClientWidth(); int height = Window.getClientHeight(); //instantiate image and add loadListeners: Image img = new Image("example.jpg"); img.addLoadListener(yourloadListener); //attach image to the rootPanel in a place not visible to the user, this is where the actual loading takes place RootPanel.get.add(img, width, height); //use onLoad to put the image in the right place This has the effect of showing scrollbars (which you can hide) but the code gets more complicated and it's beyond what I wantedto show you Cheers, Salvador On Apr 15, 9:01 am, dduck <anders.johansen.a...@gmail.com> wrote: > Hi, > > Is there a cross-browser compatible, sure-fire way to tell if an image > is loaded? I have used Loadlistener observers, but they do not work > consistently on IE, and that's a deal breaker... > > I need it for delaying preloading of hidden images until the visible > ones have loaded, or have failed loading. > > Regards, > Anders S. Johansen, ange.dk --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---