code: public boolean imageUpdate(Image img, int flags, int x, int y, int newWidth, int newHeight)
      {
          // http://www.permadi.com/tutorial/javaImgObserverAndAnimGif/
  
          // error
          if ((flags & (ABORT | ERROR)) != 0)
          {
              synchronized (this)
              {
                  if (image == img)
                  {
                      abort();
                  }
              }
  
              repaint(0);
              return false;
          }
  
          // Repaint when done or when new pixels arrive:
          // FRAMEBITS - another complete frame of a multi-frame image which was
          // previously drawn is now available to be drawn again.
          // ALLBITS - static image which was previously drawn is now complete and
          // can be drawn again in its final form.
          if ((flags & (FRAMEBITS | ALLBITS)) != 0)
          {
              repaint(0);
          }
  
          if ((flags & ALLBITS) != 0)
          {
              complete = true;
          }
  
          // hint : provide some "Loading..." animation...
          // else if ((flags & SOMEBITS) != 0) {}
          return ((flags & ALLBITS) == 0) /* && owner.isVisible() */;
      }
docs: ======================================================================================================