how to load a image from web in java

后端 未结 4 2177
[愿得一人]
[愿得一人] 2020-12-28 14:57

I need to load an image from a web in a simple Java stand alone aplication. Any Ideas?

4条回答
  •  执念已碎
    2020-12-28 15:29

    You can load an image using

    BufferedImage img = ImageIO.read(new URL("http://stackoverflow.com/content/img/so/logo.png"));
    

    For methods how to display the loaded image, see the Sun "Working with images" tutorial.

提交回复
热议问题