DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2005
    Posts
    3

    getting images from web help needed.

    Hi all
    I want my program to get number of images from the web
    http://www.url.com/img01.jpg
    .
    .
    .
    http://www.url.com/img99.jpg
    What should I use in order to read images and save it to my hard drive?
    URL url = new URL("http://www.url.com/img01.jpg");
    InputStream is = urlConnection.getInputStream();
    something like that?
    but it does not work and I don't know how to "convert" inputstream to file....
    Please help!

  2. #2
    Join Date
    May 2005
    Posts
    3
    anyone?

  3. #3
    Join Date
    Nov 2004
    Posts
    13

    Get image from web

    import java.awt.*;
    import java.applet.*;
    import java.util.Date;
    import java.net.URL;
    import java.net.MalformedURLException;

    .......

    Image Girl1;
    Image Girl2;
    Image Girl3;
    Image Girl4;
    Image Girl5;
    Image Girl6;

    ........

    public void init()
    {
    Girl1 = getImage(getCodeBase(),"g1.gif");
    Girl2 = getImage(getCodeBase(),"g2.gif");
    Girl3 = getImage(getCodeBase(),"g3.gif");
    Girl4 = getImage(getCodeBase(),"g4.gif");
    Girl5 = getImage(getCodeBase(),"g5.gif");
    Girl6 = getImage(getCodeBase(),"g6.gif");
    love = getImage(getCodeBase(),"love.gif");
    JAVA6 = getImage(getCodeBase(),"java.gif");
    }

    .......

    Graphics g = getGraphics();
    g.drawImage(Girl1,20,20,this);

    .......

    Free JAVA tutorial for game programmer http://www.geocities.com/aboutsoft/

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links