0

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 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);
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Nubkadiya
  • 3,285
  • 13
  • 40
  • 45
  • 1
    You asked the same question 3 hours ago: http://stackoverflow.com/questions/2943680/how-to-display-a-image-in-java-application Please don't duplicate questions. If you can't find your questions back, please click anywhere your name appears as a link (e.g. in top bar) for your question history. – BalusC May 31 '10 at 16:23

1 Answers1

2
JLabel label = new JLabel(new ImageIcon(image));
Jack
  • 131,802
  • 30
  • 241
  • 343