AllExperts > Experts 
Search      

Java

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Java Answers
Question Library

Ask a question about Java
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Artemus Harper
Expertise
I have experence in Core Java, good background in Java swing/gui, some experence with JNI, Java reflection, and Java java.nio.* knowledge of Java bytecode and retrofitting non-open source code to paticular needs. Basics in c++

Experience
Currently working full time to produce applications to help with OWL ontologies I do not have experence with J2ME,or database applications. I do not have experence with IDEs except for Eclipse.
 
   

You are here:  Experts > Computing/Technology > Focus on Java > Java > progress bar

Topic: Java



Expert: Artemus Harper
Date: 6/5/2008
Subject: progress bar

Question
i am working on a project called web spider where i am displaying all the hyperlinks of a web page.this displaying of links take some time, so i want to put a progress bar.but i don't know how to make it work accordingly. similarly while downloading the web pages, some time is taken..and for this also i want to put a progress bar..i know how to create a progress bar, but how to make it work according to my project is what i am not getting..can you please send me the code for it.do you want me to send you my project??

Answer
When you have a URL, you can use getConnection to get a URLConnection. From there you can call getContentLength() to get how big the web page is. This value may not always be given by the server, and in that case -1 is returned. You can call getInputStream on the URLConnection to start the download.

For web crawling it is not possible to get an overall estimate, since links may go to other links and it is not possible to know how deep or how big a page is until you visit it.

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.