getImage problem - Java

Argh.  Why don\'t I know these things?

In brief, getImage returns immediately (i.e. if you read a graphic and there\'s a problem, it can\'t tell you! For me, the error got spit out later on when trying to write the file back to disk...). 

You should (must?!) use a MediaTracker to make sure your jpg, gif, or whatever actually loaded without problems (like missing files or permissions or whatever).

Sheesh...

Reference: http://java.sun.com/docs/books/tutorial/uiswing/painting/usingImages.html

\"The getImage methods return immediately, so that you don\'t have to wait for an image to be loaded before going on to perform other operations in your program. While this improves performance, some programs require more control or information about image loading. You can track image loading status either by using the MediaTracker class or by implementing the imageUpdate method, which is defined by the ImageObserver interface.\"

Related Scribbles:
  • Java Notes


  • ID: 341
    Author:
    leonard
    Date Updated:
    2003-12-23 00:22:55
    Date Created:
    2003-10-20 01:08:51

    Edit

    Comments?
     >> Leonard Chan's Homepage  >> Scribble Web  >> getImage problem - Java
    leonard.lotus-land.ca is hosted by Perceptus Solutions Inc.