Hi,
I am very new to JMonkey and this is my first post here, hope this is the correct section
I tried 3 JMonker 2.1 tutorials so far. None of them loaded any images. I get following warning when I run in Lesson 2.
Jun 4, 2011 4:11:17 PM com.jme.util.TextureManager loadTexture
WARNING: Could not load image. Specified URL is null.
Jun 4, 2011 4:11:24 PM com.jme.app.BaseGame start
INFO: Application ending.
And in Lesson 3 following exception is thrown
Jun 4, 2011 4:18:22 PM class jme.test.Lesson3 start()
SEVERE: Exception in game loop
java.lang.NullPointerException
at javax.swing.ImageIcon.(ImageIcon.java:167)
at jme.test.Lesson3.buildTerrain(Lesson3.java:199)
at jme.test.Lesson3.initGame(Lesson3.java:151)
at com.jme.app.BaseGame.start(BaseGame.java:74)
at jme.test.Lesson3.main(Lesson3.java:62)
at jme.test.Main.main(Main.java:14)
Jun 4, 2011 4:18:22 PM com.jme.app.BaseGame start
INFO: Application ending.
This is the related code snippet
[java]// generate a terrain texture with 3 textures
ProceduralTextureGenerator pt = new ProceduralTextureGenerator(heightMap);
pt.addTexture(new ImageIcon(Lesson3.class.getClassLoader().getResource("/home/user/NetBeansProjects/Hello3D/images/grassb.png")), -128, 0, 128); //line 199
pt.addTexture(new ImageIcon(Lesson3.class.getClassLoader().getResource("dirt.jpg")), 0, 128, 255);
pt.addTexture(new ImageIcon(Lesson3.class.getClassLoader().getResource("highest.jpg")), 128, 255, 384);
pt.createTexture(32);[/java]
I am very positive that there is nothing wrong with file paths. Could someone help me.
Thank you in advance