[Solved] Importing .obj in a java Monkey/Swing application

I've been using two exemple to build my own version. The first is the jmetest.util.JMESwingTest and it form the base of my new application. I wanted to change the rotating cube by an .obj model created with sketchup. I first tried to use jmetest.renderer.loader.TestObjJmeWrite but I wasn't able to load my own .obj correctly…probably because of this line:

URL objFile=TestObjJmeWrite.class.getClassLoader().getResource("jmetest/data/model/maggie.obj");

The new line after my modification:

URL objFile=TestObjJmeWrite.class.getClassLoader().getResource("C:/Users/K

This was easy to solve…I wasn't understanding really what I was doing…This line corrected my problem:

URL objFile=new File("C:/Users/K

getClassLoader().getResource() can only find resources that are on your class path.

You seem to try to load a file somewhere else on your computer, so, using an absolute path works.