List of utility methods to do Image Wait
Image | waitFor(Image image) Wait until the image has been loaded completely try { MediaTracker tracker = new MediaTracker(DUMMY_COMP); tracker.addImage(image, 0); tracker.waitForAll(); } catch (InterruptedException e) { return image; |
void | waitForImage(Image image) wait For Image new ImageIcon(image).getImage();
|
boolean | waitForImage(Image image) wait For Image int id; synchronized (component) { id = sid++; tracker.addImage(image, id); try { tracker.waitForID(id); } catch (InterruptedException e) { ... |
boolean | waitForImage(Image image) Waits for an image to load fully. int id; synchronized (sComponent) { id = sID++; sTracker.addImage(image, id); try { sTracker.waitForID(id); } catch (InterruptedException ie) { ... |
boolean | waitForImage(Image image, Component c) Returns true if the given image is loaded successfully.
MediaTracker tracker = new MediaTracker(c); tracker.addImage(image, 0); try { tracker.waitForAll(); } catch (InterruptedException ie) { return (!tracker.isErrorAny()); |
boolean | waitForImage(Image image, Component component) wait For Image try { MediaTracker mediaTracker = new MediaTracker(component); int i = new Random().nextInt(); mediaTracker.addImage(image, i); mediaTracker.waitForID(i); return true; } catch (InterruptedException e) { return false; ... |
boolean | waitForImage(Image image, Component component) Wait for an image to be ready MediaTracker mediaTracker = new MediaTracker(component); mediaTracker.addImage(image, 0); try { mediaTracker.waitForID(0); } catch (InterruptedException e) { return false; return true; ... |
void | waitForImage(java.awt.Image image) Waits until image is fully loaded, so ready for drawing. BufferedImage bufferedImage = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = bufferedImage.createGraphics(); final Object done = new Object(); ImageObserver imageObserver = new ImageObserver() { public boolean imageUpdate(java.awt.Image img, int flags, int x, int y, int width, int height) { if (flags < ALLBITS) { return true; } else { ... |
void | waitForImage(java.awt.Image image) wait For Image s_mediaTracker.addImage(image, 0); try { s_mediaTracker.waitForID(0); } finally { s_mediaTracker.removeImage(image); |
void | waitForImageData(Image image, Component comp) Waits until all the data of an Image is present. if (comp == null) { comp = HELPER_LABEL; MediaTracker tracker = new MediaTracker(comp); tracker.addImage(image, 0); try { tracker.waitForID(0); } catch (Exception ex) { ... |