First I want to say hey to all 
I have been programming with java about a year now.
I also study computer science in university of Jyvaskyla in Finland and I’m starting my second year.
That’s for me for now and to my problem which has been bothering me.
Here is working piece of code:
Image source = null;
URL ur l= this.getClass().getClassLoader().getResource(ref);
if(url == null) return null;
try {
source = ImageIO.read(url);
}
catch (IOException ex) {
}
ImageIO.read(url);
this returns BufferedImage type object…
but the piece of code what confuses me alot
BufferedImage sourceImage = null;
try {
URL url = this.getClass().getClassLoader().getResource(ref);
if (url == null) {
return null;
}
// use ImageIO to read the image in
System.out.println(url); // this prints the rigth path
sourceImage = ImageIO.read(url);
} catch (IOException e) {
}
System.out.println(sourceImage); // this prints null!! ???
and here I have used “correctly” ImageIO.read(url) -method…
Thanks Kev Glass for the great tutorial of SpaceInvaders 
T: Juenvalj