The Artima Developer Community
Sponsored Link

Java Answers Forum
Creaing a BufferedImage

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Clinton Muvezwa

Posts: 2
Nickname: worker99
Registered: Jan, 2008

Creaing a BufferedImage Posted: Jan 31, 2008 1:57 PM
Reply to this message Reply
Advertisement
I have this code which is not working. Does anyone have an idea why?

public static BufferedImage loadImage(){
BufferedImage bimg = null;
try{
bimg = ImageIO.read(new File("mySkin.jpg"));
}catch (IOException e) {
e.printStackTrace();
}
return bimg;
}

Errors:

javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(Unknown Source)
at Components.ImageApp.loadImage(ImageApp.java:28)
at Components.ImageApp.loadAndDisplayImage(ImageApp.java:17)
at Components.ImageApp.main(ImageApp.java:40)
Exception in thread "main" java.lang.NullPointerException
at Components.ImageApp.loadAndDisplayImage(ImageApp.java:18)
at Components.ImageApp.main(ImageApp.java:40)

Topic: Creaing a BufferedImage Previous Topic   Next Topic Topic: Guide, Tutorial or book on how to use MS access database with Java

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use