Separate names with a comma.
Discussion in 'Archived Threads 2001-2004' started by Jay H, Apr 17, 2002.
public Image getImage(URL url,
Returns an Image object that can then be painted on the screen. The url argument must specify an absolute URL. The name argument is a specifier that is relative to the url argument.
This method always returns immediately, whether or not the image exists. When this applet attempts to draw the image on the screen, the data will be loaded. The graphics primitives that draw the image will incrementally paint on the screen.
url - an absolute URL giving the base location of the image.
name - the location of the image, relative to the url argument.
the image at the specified URL.
Image" -- Java API Documentation
Doesn't return 'null' if it doesn't exist. It must actually create a (0,0) image? You could check whether the height or width is 0, which would mean there is no data, but it apparently does instantiate it, no matter what.
I'm just going off the documentation here, I've not tried this myself.
Yahh, I swear to the Java Gods I thought it said it returns Null, it could possibly be another getImage from another class... Oh well, I thought I was going crazy for a second. I am using a check to Img.getWidth(this) == -1 to see if there is an image or not. It works fine...