Progress bar to show the progress of a task

Discussion in 'Java' started by Charlie Zhang, Aug 16, 2004.

  1. In my application one click on the start button will fire one specific
    task which includes some numerical computation routines and data
    visualization routines.

    Want to use progress bar to show the progress of the task execution,
    even after reading sun's java swing tutorials still not clear how to
    set the maximum length of the progress bar and update the progress
    status.

    Really appreciate your time and kind help!

    Thanks a lot.
    Charlie Zhang, Aug 16, 2004
    #1
    1. Advertising

  2. Charlie Zhang

    Liz Guest

    "Charlie Zhang" <> wrote in message
    news:...
    > In my application one click on the start button will fire one specific
    > task which includes some numerical computation routines and data
    > visualization routines.
    >
    > Want to use progress bar to show the progress of the task execution,
    > even after reading sun's java swing tutorials still not clear how to
    > set the maximum length of the progress bar and update the progress
    > status.
    >
    > Really appreciate your time and kind help!
    >
    > Thanks a lot.


    Only your application can know how long the task is going to be.
    If you are reading a file, for example, you can map the file size
    to 100% and the current position in the file divided by the file
    size to be the current completion percent. If you just want to know
    how to set the value: setProgress(50); will set it to 50%
    Liz, Aug 16, 2004
    #2
    1. Advertising

  3. >
    > Only your application can know how long the task is going to be.
    > If you are reading a file, for example, you can map the file size
    > to 100% and the current position in the file divided by the file
    > size to be the current completion percent. If you just want to know
    > how to set the value: setProgress(50); will set it to 50%


    Thanks a lot, but actually the task associated with that button is
    complicated and hard to estimate the whole work load. Maybe I shall
    consider other swing feature to just show that the computer is busy.
    Is cursor a good
    choice?

    Thanks so much.
    Charlie Zhang, Aug 16, 2004
    #3
  4. Charlie Zhang

    Paul Lutus Guest

    Charlie Zhang wrote:

    >>
    >> Only your application can know how long the task is going to be.
    >> If you are reading a file, for example, you can map the file size
    >> to 100% and the current position in the file divided by the file
    >> size to be the current completion percent. If you just want to know
    >> how to set the value: setProgress(50); will set it to 50%

    >
    > Thanks a lot, but actually the task associated with that button is
    > complicated and hard to estimate the whole work load.


    Translation: "I cannot determine in advance a total count, but I want to
    show task progress." Is this correct? If so:

    JProgressBar.setIndeterminate

    public void setIndeterminate(boolean newValue)

    Sets the indeterminate property of the progress bar, which determines
    whether the progress bar is in determinate or indeterminate mode. An
    indeterminate progress bar continuously displays animation indicating that
    an operation of unknown length is occurring. By default, this property is
    false. Some look and feels might not support indeterminate progress bars;
    they will ignore this property.

    --
    Paul Lutus
    http://www.arachnoid.com
    Paul Lutus, Aug 16, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    0
    Views:
    3,540
  2. John Hann
    Replies:
    0
    Views:
    6,072
    John Hann
    Aug 21, 2004
  3. =?Utf-8?B?cHVya2th?=

    ASPNET 2.0: Progress bar while long taking task

    =?Utf-8?B?cHVya2th?=, Jan 8, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    457
    =?Utf-8?B?cHVya2th?=
    Jan 8, 2006
  4. Matt
    Replies:
    9
    Views:
    70,829
  5. Rob

    progress bar or guage bar

    Rob, Jul 11, 2003, in forum: ASP General
    Replies:
    6
    Views:
    198
    Chris Barber
    Jul 12, 2003
Loading...

Share This Page