Java Image Wait waitForImage(Image image, Component component)

Here you can find the source of waitForImage(Image image, Component component)

Description

wait For Image

License

Open Source License

Declaration

public static boolean waitForImage(Image image, Component component) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.*;

import java.util.Random;

public class Main {
    public static boolean waitForImage(Image image, Component component) {
        try {//from ww w. j  a va 2s. com
            MediaTracker mediaTracker = new MediaTracker(component);
            int i = new Random().nextInt();
            mediaTracker.addImage(image, i);
            mediaTracker.waitForID(i);
            return true;
        } catch (InterruptedException e) {
            return false;
        }
    }
}

Related

  1. waitFor(Image image)
  2. waitForImage(Image image)
  3. waitForImage(Image image)
  4. waitForImage(Image image)
  5. waitForImage(Image image, Component c)
  6. waitForImage(Image image, Component component)
  7. waitForImage(java.awt.Image image)
  8. waitForImage(java.awt.Image image)
  9. waitForImageData(Image image, Component comp)