Getting Image from URL (Java)

前端 未结 6 2066
长发绾君心
长发绾君心 2020-12-10 01:09

I am trying to read the following image

\"enter

But it is showing IIOException

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-10 01:37

    Try This:

    //urlPath = address of your picture on internet
    URL url = new URL("urlPath");
    BufferedImage c = ImageIO.read(url);
    ImageIcon image = new ImageIcon(c);
    jXImageView1.setImage(image);
    

提交回复
热议问题