[3021] in java-interest

home help back first fref pref prev next nref lref last post

Re: HELP NEEDED: Images Drawn Before Loaded

daemon@ATHENA.MIT.EDU (Jim.Graham@Eng.Sun.COM)
Thu Oct 26 22:37:56 1995

Date: Thu, 26 Oct 1995 18:05:31 -0700
To: java-interest@java.Eng.Sun.COM, irogers@ghostfacekiller.biggun.com
From: Jim.Graham@Eng.Sun.COM

> I'm writing an applet which animates some images based on the Animation
> applet, using synchronous notification via a notifyAll() in the
> updateImage() method.
> 
>  One of my functions is doing a wait(), and hearing back from the
> updateImage(), but the app is running away before the images are
> loaded.  It displays the images before they've been fetched (most
> likely as soon as the width info can be determined, correct?).

Width info is available well before the image data is loaded.  If you
want to do this right, just use the MediaTracker class which is documented
and can be downloaded from a pointer off my home page:

	http://java.sun.com/people/flar/

> Here are the methods in question:

It is hard to tell why your code isn't working since you didn't include
key pieces (like the prefetch method).  The easiest way to fix it is to
delete it all and just use the MediaTracker class mentioned above.

				...jim
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post