I have seen many other people ask this question here and here , but it seems that I have done everything I need, but I still get null when using the getResourceAsStream () call.
In netbeans, I dragged my image into my package and it appears in the folder where the source code and .class files are stored. So what am I: CIC \ com \ MyProject \ ClassIMakeTheCallFrom.java CIC \ com \ MyProject \ MyImage.png
a similar structure exists in: build \ classes \ com \ MyProject \ ClassIMakeTheCallFrom.class build \ classes \ com \ MyProject \ MyImage.png
However, when I make a call:
System.out.println(dolphinWater.class.getClassLoader().getResourceAsStream("myImage.png"));
It turns out null. Did I miss something?
java jnlp netbeans
BOMEz Aug 10 '11 at 20:28 2011-08-10 20:28
source share