Image I = getImage(getCodeBase(), "1.gif"); Image I = getImage(getDocumentBase(), "1.gif"); both of these return a java.lang.NullPointerException WHY? The file is in the directory. What am I doint wrong?? Shawn
Shawn, There is nothing wrong with either line, so there must be a problem either somewhere else in the code or in the location of the files. Here is a little test:
and the html
Compile ImageLoader.java and put the resulting class file (ImageLoader.class), the html file, and your image file in the same directory. This should work. Then compare your code to it to see what is different. If you still have problems, let us know.
[This message has been edited by Carl Trusiak (edited November 30, 2000).]