Width (-1) and height (-1) cannot be <= 0

Hello,



I'm very new to jmonkey as you understand from the number of post.



   pt.addTexture(new ImageIcon("images/grassb.jpg"), 50, 50, 50);
   pt.addTexture(new ImageIcon("images/dirt.jpg"), 50, 128, 255);
   pt.addTexture(new ImageIcon("images/highest.jpg"), 128, 255,
         384);



From the tutoril I tried to build simple terrain but I got the error following;


SEVERE: Exception in game loop
java.lang.IllegalArgumentException: Width (-1) and height (-1) cannot be <= 0
   at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
   at java.awt.image.BufferedImage.<init>(Unknown Source)
   at com.jmex.terrain.util.ProceduralTextureGenerator.addTexture(ProceduralTextureGenerator.java:221)
   at OyunTabani.simpleInitGame(OyunTabani.java:56)
   at com.jme.app.BaseSimpleGame.initGame(BaseSimpleGame.java:544)
   at com.jme.app.BaseGame.start(BaseGame.java:74)
   at OyunTabani.main(OyunTabani.java:34)



Could you help me about this? My pictures are 50*50 . whatever the values are I got the same error.
Thanks in advance.

Looks like this is possibly a path issue and its not actually finding your images?

new ImageIcon(…) will return an object rather than null, but it will contain nothing, but it will have width and height set to -1.

As a quick test try using the full path to the image file and if that fixes the problem, then search the forum for file path issues as this has been covered here by many better than me :smiley: ( I always get it wrong )