• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 176
  • Last Modified:

progressbar

I am using progress bars in my program, is there a way to label the progress bar with a scale (say  0 - 100)so the user can tell what the exact value is.
0
psteph
Asked:
psteph
1 Solution
 
sailwindCommented:
Yes you could. This is not exactly a scale that goes across the entire bar,
but it shows the current percentage done in digits:

declare the progress bar as follows:

ProgressMonitor monitor = new ProgressMonitor(this, "Processing...","Started",0,100);

Then, for your running program, do a loop, and in the loop:

   int ticks = 0;
   for(each iterations) {
       ticks+= 10;
       monitor.setProgress(ticks);
       monitor.setNote(String.valueOf(ticks)+"%"); // displays percentage done.
   }

There, simple as that.
 

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now