Forum Stats

  • 3,782,743 Users
  • 2,254,682 Discussions
  • 7,880,151 Comments

Discussions

Quick question about JProgressBar...

843807
843807 Member Posts: 46,582
edited Feb 15, 2003 8:20PM in Java Desktop Applications
Hi all,
i have a little problem with the JProgressBar-object.The thing is that I would like to show the progress of the loading of my program, so that the user is not bored :) What I would like to do is to watch how the contructor initializes and to display this progress in a JProgressBar. I would like to show percentage of finished download instead of just having the thing moving left-right in progress bar. I have read a tutorial on java�s homepage, but it is not helping. I am not using any threads for initializing the constructor. Any help would be very appriciated.

Thank you

Comments

  • 843807
    843807 Member Posts: 46,582

    Use the various "string painted" methods to
    show a percentage complete message. Scale the
    value of setValue()/getValue() against the
    maximum value to get percentage complete.

    You will probably want to put this all on
    its own thread so it can update regardless of
    what's going on with the task that it's monitoring.

    Use interdeterminate mode if the task reaches
    a point where it should be finished (100% complete)
    but isnt'.
This discussion has been closed.