| Reply | « Previous Thread | Next Thread » |
|
hi guys
i get a IOException when trying to create an image from a png file; can anyone help? the png is located in the root of the jar and i am using the following code: image.createImage("/texture.png"); any ideas what is wrong? |
|
i just got that problem too few hours ago :)
i used 'try' and it works ================= try { image = Image.createImage(your_path); } catch { } =================
Last edited by hrahman : 2004-06-07 at 05:31.
|
|
Unfortunately, I’ve got a similar problem and an Exception is still raised.
try { String stemp =”/OffPU2.PNG"; Image itemp1 = Image.createImage(stemp); } catch (IOException e) { System.out.println(e.toString()); } itemp1 is still null after this code. Can Anybody Help ? |
|
u have specified the name of the img in uppercase and also the extension in uppercase. is it stored in ur directory in the same case. check this out. this might be the solution in ur case.
Gaurav. |
| gauravgandhi80 |
| View Public Profile |
| Find all posts by gauravgandhi80 |
|
Try putting your image into the /res directory, created in the jar root directory. Also, check if your png is in a jar at all.
|
|
Got it working.
My mistake, I needed to specify the path correctly. Will remember about the res Directory though. Thanks for everybody's help. |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|