Using my own resources (outside of jME package)

I am playing around with the flagrush tutorials, and I simply want to change the graphic on the properties box at startup. I'm setup in eclipse, using the cvs install for jme. I have my test project folder with a res folder in it. The res folder contains my logo.png.

I tried changing the resourceloader line to read "res/logo.png". However, it ends up loading null (it can't find the image). I did some checking and it turns out the code is reading from jme.bin.

Why isn't it reading from my project folder? How do I fix it?



Here is the code snippet:

public static void main(String[] args) {
        Labyrinth app = new Labyrinth();
        // We will load our own "fantastic" Flag Rush logo. Yes, I'm an artist.
        app.setDialogBehaviour(ALWAYS_SHOW_PROPS_DIALOG, Labyrinth.class.getResource(
                        "res/logo.png"));
        app.start();
    }

Well, first, you should use the ResourceLocator built precisely to handle these cases. On the other hand, the problem with the class.getResource method is that is uses the classpath as the places to search… if you don’t have any class in the directory where your res is, then it will not find it.



Check the thread: http://www.jmonkeyengine.com/jmeforum/index.php?topic=5707.0