Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Progress bar

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Progress bar

    Hi, i have a really simple question.
    Can someone tell me where to start when i want to add a progress bar. I have an arraylist of string. when i do a for:each loop, inside the loop i have a method that does something with each object

    for (String ipString : ipAddress.arrListOfIpAddress) { 
     
               if (ipAddress.getHostReachable(ipString)) {
                  modelIPAddressListModel.addElement(ipString + " is reachable");                             
               }
    }

    .How do i put in a progress bar that every time it get's the next item, the progress bar increments by one until it finishes and display's some kind of a message saying finished.


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 262 Times in 231 Posts

    Default Re: Progress bar

    Update the progress bar during the loop and display the finish message outside of and after the loop.

  3. #3
    Member Cronus's Avatar
    Join Date
    Feb 2013
    Location
    Gothenburg, Sweden
    Posts
    41
    My Mood
    Inspired
    Thanks
    6
    Thanked 7 Times in 6 Posts

    Default Re: Progress bar

    I recommend the following page: JProgressBar (Java Platform SE 7 )
    If you wish to update the JProgressBar, you should try "progressBarName.setValue(Number);" every time you finish a task. Example: The program loads all fonts, add 25% to the progress bar, etc. Good luck.

    --- Update ---

    I recommend the following page: JProgressBar (Java Platform SE 7 )
    If you wish to update the JProgressBar, you should try "progressBarName.setValue(Number);" every time you finish a task. Example: The program loads all fonts, add 25% to the progress bar, etc. Good luck.

Similar Threads

  1. Progress Bar
    By h9000458359@gmail.com in forum Java Theory & Questions
    Replies: 4
    Last Post: December 26th, 2012, 12:04 PM
  2. Progress bar in java
    By jullien in forum AWT / Java Swing
    Replies: 1
    Last Post: October 31st, 2011, 06:55 AM
  3. Progress bar in JSF
    By AmitPanchal in forum JavaServer Pages: JSP & JSTL
    Replies: 1
    Last Post: March 4th, 2011, 03:21 AM
  4. [Swing-Progress Bar] Can't resize progress bar
    By Grabar in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 14th, 2010, 12:27 PM
  5. Progress bar while uploading a file in web application
    By jazz2k8 in forum AWT / Java Swing
    Replies: 4
    Last Post: July 8th, 2008, 07:32 AM