• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Applet images

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Straws are for suckers. Now suck on this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic