> I've read all I can about what imageObserver is and how to
> implement/use it. After several hours of reading, I am still failing.
[quoted text clipped - 13 lines]
> Image i = (Toolkit.getDefaultToolkit()).getImage
> ("C:/map7bg.bmp");
There are several problems with the line above:
(*) Toolkit.getImage doesn't support BMP files (only GIF, JPEG, XBM, PNG).
(*) "C:/map7bg.bmp" has the wrong slash. Use "C:\\map7bg.bmp" on Windows.
(*) Applet security normally forbids accessing local files.
(*) Your paint-method might be called several hundred times per second.
It is therefore a bad idea to call getImage(...) here. You should
make i a member variable and put the 'i = ...;' code somewhere else,
may be in your applet's init() method.
> g.drawImage(i,1,1, this); //also tried null instead of null
> }
[quoted text clipped - 5 lines]
> }
> }
Normally you should *not* implement an imageUpdate(...) method of your own.
java.applet.Applet has already an imageUpdate(...) method (inherited from
java.awt.Component) which does a fine job. Your implmenentation is
especially wrong, because your "return false;" means: 'I have received the
complete image now. Don't call imageUpdate(...) again!'. See also the API
doc Component#imageUpdate and may be the source code of
Component#imageUpdate, too.
> </code>
>
[quoted text clipped - 3 lines]
> Thanks in advance for any help,
> Dima

Signature
"Thomas:Fritsch$ops.de".replace(':', '.').replace('$', '@')
alexandre_paterson@yahoo.fr - 18 Apr 2006 15:59 GMT
...
> (*) "C:/map7bg.bmp" has the wrong slash. Use "C:\\map7bg.bmp" on Windows.
Actually the forward slash works just fine as a file separator under
Windows in this case.
:)