Getting an Image from a URL

try { // Create a URL for the image's location URL url = new URL("http://hostname:80/image.gif"); // Get the image java.awt.Image image = java.awt.Toolkit.getDefaultToolkit().getDefaultToolkit().createImage(url); } catch (MalformedURLException e) { } catch (IOException e) { }

Comments

22 May 2010 - 8:14pm by pankaj singhal (not verified)

how to get url for my pic

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.