GeezerVison is showing docs.oracle.com — MediaTracker (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
java.awt
Class MediaTracker
-
-
Field Summary
Fields
| Modifier and Type |
Field |
Description |
static int |
ABORTED |
Flag indicating that the downloading of media was aborted.
|
static int |
COMPLETE |
Flag indicating that the downloading of media was completed
successfully.
|
static int |
ERRORED |
Flag indicating that the downloading of media encountered
an error.
|
static int |
LOADING |
Flag indicating that media is currently being loaded.
|
-
Constructor Summary
Constructors
| Constructor |
Description |
MediaTracker(Component comp) |
Creates a media tracker to track images for a given component.
|
-
Method Summary
All Methods Instance Methods Concrete Methods
| Modifier and Type |
Method |
Description |
void |
addImage(Image image,
int id) |
Adds an image to the list of images being tracked by this media
tracker.
|
void |
addImage(Image image,
int id,
int w,
int h) |
Adds a scaled image to the list of images being tracked
by this media tracker.
|
boolean |
checkAll() |
Checks to see if all images being tracked by this media tracker
have finished loading.
|
boolean |
checkAll(boolean load) |
Checks to see if all images being tracked by this media tracker
have finished loading.
|
boolean |
checkID(int id) |
Checks to see if all images tracked by this media tracker that
are tagged with the specified identifier have finished loading.
|
boolean |
checkID(int id,
boolean load) |
Checks to see if all images tracked by this media tracker that
are tagged with the specified identifier have finished loading.
|
Object[] |
getErrorsAny() |
Returns a list of all media that have encountered an error.
|
Object[] |
getErrorsID(int id) |
Returns a list of media with the specified ID that
have encountered an error.
|
boolean |
isErrorAny() |
Checks the error status of all of the images.
|
boolean |
isErrorID(int id) |
Checks the error status of all of the images tracked by this
media tracker with the specified identifier.
|
void |
removeImage(Image image) |
Removes the specified image from this media tracker.
|
void |
removeImage(Image image,
int id) |
Removes the specified image from the specified tracking
ID of this media tracker.
|
void |
removeImage(Image image,
int id,
int width,
int height) |
Removes the specified image with the specified
width, height, and ID from this media tracker.
|
int |
statusAll(boolean load) |
Calculates and returns the bitwise inclusive OR of the
status of all media that are tracked by this media tracker.
|
int |
statusID(int id,
boolean load) |
Calculates and returns the bitwise inclusive OR of the
status of all media with the specified identifier that are
tracked by this media tracker.
|
void |
waitForAll() |
Starts loading all images tracked by this media tracker.
|
boolean |
waitForAll(long ms) |
Starts loading all images tracked by this media tracker.
|
void |
waitForID(int id) |
Starts loading all images tracked by this media tracker with the
specified identifier.
|
boolean |
waitForID(int id,
long ms) |
Starts loading all images tracked by this media tracker with the
specified identifier.
|
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
addImage
public void addImage(Image image,
int id)
Adds an image to the list of images being tracked by this media
tracker. The image will eventually be rendered at its default
(unscaled) size.
- Parameters:
image - the image to be tracked
id - an identifier used to track this image
-
addImage
public void addImage(Image image,
int id,
int w,
int h)
Adds a scaled image to the list of images being tracked
by this media tracker. The image will eventually be
rendered at the indicated width and height.
- Parameters:
image - the image to be tracked
id - an identifier that can be used to track this image
w - the width at which the image is rendered
h - the height at which the image is rendered
-
removeImage
public void removeImage(Image image,
int id)
Removes the specified image from the specified tracking
ID of this media tracker.
All instances of Image being tracked
under the specified ID are removed regardless of scale.
- Parameters:
image - the image to be removed
id - the tracking ID from which to remove the image
- Since:
- JDK1.1
- See Also:
removeImage(java.awt.Image),
removeImage(java.awt.Image, int, int, int)
-
removeImage
public void removeImage(Image image,
int id,
int width,
int height)
Removes the specified image with the specified
width, height, and ID from this media tracker.
Only the specified instance (with any duplicates) is removed.
- Parameters:
image - the image to be removed
id - the tracking ID from which to remove the image
width - the width to remove (-1 for unscaled)
height - the height to remove (-1 for unscaled)
- Since:
- JDK1.1
- See Also:
removeImage(java.awt.Image),
removeImage(java.awt.Image, int)
Java™ Platform Standard Ed. 8
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|