• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet images

 
jack nick
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there,
Now I seem to be having a real strange problem. I have an applet with is has 4 images all of which I am loading together, when I mean loading I mean getting the images into an image object.
The problem occurs when the applet is loaded for the first time. One of these images dont seem to come up everytime. For some strange reason when the repaint method is called on click of a reset button, this missing image appears.
Could anybody help me stop pulling my hair as to why this irational behaviour.
Thks,
Jack
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's actually not irrational behavior, but it sure can seem that way when experienced for the first time.
Take a look at java.awt.MediaTracker and see if you don't get an idea as to what's going on and how you can better control the display of your images.
 
jack nick
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gee thanks mate, this sure works fine now. Just one thought baffling though is as to why out of the 4 images it was always a particular one that was bumming up. Checked the fact that all my images were of the same size, width and height. Could there be any specific reason cos thought it works perfect, i am still curious as to why this happens.
jack
 
jack nick
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there,
i must be going blind, guess what my code already did have the media tracker somewhere in that big spagetti code that i had to debug and guess which images was missing to be added to the media tracker. - the cancel button. now this solves my problem completely. Thanks dirk.
Jack
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic