Loading Images in a Canvas

Hey
I am fairly new to Java, but I am using it for a class I am in. I am programming a to down style game for my project and need to load some images. I have tried all sorts of methods, but I can't seem to get any to work. What I am trying to do is make a load image function that will load .pngs and return them to the variable. I originally used toolKit to load them, and there were no errors. Then I output the image in my render function using g.drawImage(name, int, int, int, int, this), but nothing showed up on the canvas. Any help would be greatly appreciated!
Thanks

Re: Loading Images in a Canvas

Either the loading of the image fails or the drawing of the image fails; check if the image loads (check if the image is non-null) and check if you get null pointer exceptions. If you can't find it post a bit of code that demonstrates the problem (leave out the irrelevant stuff as much as possible).

kind regards,

Jos

I have the stamina of a seal; I lie on the beach instead of running on it.

Re: Loading Images in a Canvas

I just used a little if statement in the render function that outputted if the image was null.

Java Code:

if (tileExt[0] == null {
System.out.println("Image is null");
}

The check was returning that it was true. Is it possible that I am not loading the images correctly. I created a folder in the project called extTileSet. Am I right to write the string name of the image as "/extTileSet/****.png"?

Re: Loading Images in a Canvas

The issue with that is that I am moving between Windows and Linux, mostly I'm using Linux though. I have the project, called Bushido, and within that project is the src folder, and finally, in there I have extTileSet and gamePackage. Am I right to put the images in the gamePackage folder, or should the folder be in the gamePackage?

Re: Loading Images in a Canvas

Well, I loaded the program up today and commented out the pain function, going back to my original render function, and it worked. I'm not quite sure whether or to be terribly annoyed or to be leaping with joy. Thank you so much for all your help! I appreciate it!