Problem loading images - please help
Hi,
I have a slight problem loading images. I'm using netbeans 5.0 and have a few packages setup in a project called Maths. In a package called LineConnection theres a class that needs to read an image and display it on screen. To load the image I use:
URL url = getClass().getResource("fraction/pic1.png");
Image img1 = Toolkit.getDefaultToolkit().getImage(url);
This loads the image and I can display it on screen fine.
The problem is that the folder fractions with the images inHAS to be located within the Maths/build/class/LineConnection folder otherwise it wont load the image and I get a null pointer exception.
I want to be able to have the folder containing the images in folder Maths so that it's one folder above the src folder. But if I put it here (or anywhere else) the images can't be found and loaded.
Could someone tell me why the images can only be found if they're within the build folder because it's causing me some problems when I try to create an executable JAR.
Cheers

