private static void downImg(String url_img)
{
try {
BufferedImage buff = ImageIO.read(new URL(url_img));
ImageIO.write(buff, "png", new File("D:\\1.png"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
抛出的异常
   javax.imageio.IIOException: Can't get input stream from URL!有没有碰到过的,thanks !url图片IIOExceptionImageIO

解决方案 »

  1.   

    url_img是什么 ?
    类似http://xxx.jpg ?
      

  2.   

    你是不是没在url前面加
    http
      

  3.   


    String url_img = "http://t4.mangafiles.com/Files/Images/54/75654/JOJO_001.png";
      

  4.   

    String url_img = "http://t4.mangafiles.com/Files/Images/54/75654/JOJO_001.png";
    加了
      

  5.   

    貌似只有我的浏览器能打开,郁闷中!
    这是图片的源地址:http://www.imanhua.com/comic/54/list_77824.html
    你看能不能把图片下载下来?