When using this line in my program, is always takes a null value: InputStream is = MyClass.class.getResourceAsStream(file); I thought it could be that I didn't copy the file in the correct folder, so I tried this: File my_file = new File (file); The getAbsolutePath( ) method returned the right path, so I did this: InputStream is = MyClass.class.GetResourceAsStream(my_file.getAbsol utePath( )); It didn't work either. I don't know what to do to solve it. Can somebody help me? Thanks.