开发者

how to display a image in java application after downloading the image

i want to display a image after downloading that image from a web-server

i have wrote the code for downloading the image. but i cant set it up to a label or any thing other than jframe (because i want to add more buttons 开发者_JS百科and labels to the GUI).

here is the code to download the image from the webserver. now i want to set it to a label. please help me

URL url = new URL("http://www.personal.psu.edu/acr117/blogs/audrey/images/image-2.jpg");
image = ImageIO.read(url);


JLabel label = new JLabel(new ImageIcon(image));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜