Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-20-2007, 09:32 PM
Member
 
Join Date: May 2007
Posts: 10
Valeriano is on a distinguished road
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?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-20-2007, 09:35 PM
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
Yes, Java has excellent built-in support for networking.

You can use the following code to download the image:

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) { }
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
image download from server willemjav Java Applets 2 04-03-2008 11:13 PM
Converting multiple banded image into single banded image... Image enhancement archanajathan Advanced Java 0 01-08-2008 06:29 PM
What jdk do I download? padutch2 New To Java 3 11-29-2007 05:28 AM
I could download JDK 1.5 Albert New To Java 2 07-13-2007 04:36 PM
Download JDK 1.5 Nick15 New To Java 2 05-27-2007 10:52 AM


All times are GMT +3. The time now is 03:05 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org