Results 1 to 3 of 3
  1. #1
    tianchen is offline Member
    Join Date
    Jan 2014
    Posts
    34
    Rep Power
    0

    Default javax.imageio.IIOException

    Hi everyone,

    I got the exception by importing image using the following code:

    Java Code:
    BufferedImage myPicture = ImageIO.read(new File(bilderPath));
    my picture stored in a file called "C:\\Users\\deathlypest\\Desktop\\Scenes\\scen e1"
    How can I handle with this problem? There is even no way to debug it ;(

    Thank you very much. It will be great if you can shed some light on this kind problem in general.

  2. #2
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: javax.imageio.IIOException

    Do something like this:

    Java Code:
    try {
       BufferedImage myPicture = ImageIO.read(new File(bilderPath));
    }
    catch(IOException e) {
       e.printStackTrace();
    }
    The stack trace will contain important information about the cause. This is how you debug it.
    Get in the habit of using standard Java naming conventions!

  3. #3
    tianchen is offline Member
    Join Date
    Jan 2014
    Posts
    34
    Rep Power
    0

    Default Re: javax.imageio.IIOException

    Thank you very much, kjkrum. The problem has been successfully solved. It is really helpful

Similar Threads

  1. javax.servlet.ServletException: javax.el.PropertyNotFoundException:
    By AAKJAVA in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 02-08-2012, 12:11 PM
  2. Replies: 0
    Last Post: 01-28-2012, 10:53 PM
  3. JPEGCodec and ImageIO
    By Lacrim in forum Advanced Java
    Replies: 0
    Last Post: 12-14-2011, 03:57 PM
  4. Replies: 4
    Last Post: 04-01-2011, 08:47 PM
  5. Help with ImageIO
    By romina in forum AWT / Swing
    Replies: 1
    Last Post: 08-07-2007, 06:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •