Second app. Im so stupid

I have the following code. package classes;

import com.jme.app.BaseGame;

import com.jme.scene.shape.Sphere;

import com.jme.bounding.BoundingBox;

import com.jme.math.Vector3f;

import com.jme.scene.state.TextureState;

import com.jme.image.Texture;

import com.jme.util.TextureManager;





public class JMonkeyEngineTest extends BaseGame{



public static void main(String[] args) {

JMonkeyEngineTest app = new JMonkeyEngineTest();

app.setDialogBehaviour(ALWAYS_SHOW_PROPS_DIALOG, JMonkeyEngineTest.class.getClassLoader()

            .getResource("C:/Documents and Settings/Andrew/My Documents/Graphics/Final Pictures/TableGlassGingerbreadMan2.jpg"));

app.start();

}



When I run it, it shows the props dialog, but with no image. why?



Thanks for all your help!

JMonkeyEngineTest.class.getClassLoader()

                .getResource(…)



checks the classpath. You are pointing to the absolute location, so don't need to use the class loader to get the url.

What should i do instead? Should i use "…/…/…/…/Graphics/Final Pictures/TableGlassGingerbreadMan2.jpg" instead?



Sorry.

Not unless that is in your classpath…



Use the file protocol to create a URL to your image file.



file:////Documents and Settings/Andrew/My Documents/Graphics/Final Pictures/TableGlassGingerbreadMan2.jpg



etc

Put it in your project src structure and reference it via either ClassLoader.getResource or Class.getResource.  Take a look at how the texture for Text is loaded somewhere down the structure of SimpleGame (I think BaseSimpleGame IIRC).