Results 1 to 2 of 2
- 05-20-2007, 08:32 PM #1
Member
- Join Date
- May 2007
- Posts
- 10
- Rep Power
- 0
How to download an image from a HTTP URL
I want to download an image from a HTTP url and show it to the user. I know how to show an image to the user if it is in the form of Image/BufferedImage but i dont know how to download it. Should i use a third party library or does Java have a built-in support for this?
- 05-20-2007, 08:35 PM #2levent Guest
Yes, Java has excellent built-in support for networking.
You can use the following code to download the image:
Java Code:try { // Create a URL for the image's location URL url = new URL("http://your-host.com/your-image.gif"); // Get the image java.awt.Image image = java.awt.Toolkit.getDefaultToolkit().getDefaultToolkit().createImage(url); } catch (MalformedURLException e) { } catch (IOException e) { }
Similar Threads
-
Download JDK 1.5
By Nick15 in forum New To JavaReplies: 4Last Post: 01-01-2009, 03:10 AM -
image download from server
By willemjav in forum Java AppletsReplies: 2Last Post: 04-03-2008, 10:13 PM -
Converting multiple banded image into single banded image... Image enhancement
By archanajathan in forum Advanced JavaReplies: 0Last Post: 01-08-2008, 05:29 PM -
What jdk do I download?
By padutch2 in forum New To JavaReplies: 3Last Post: 11-29-2007, 04:28 AM -
I could download JDK 1.5
By Albert in forum New To JavaReplies: 2Last Post: 07-13-2007, 03:36 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks