Solved

progressbar

Posted on 1998-08-17
1
164 Views
Last Modified: 2010-03-30
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
Comment
Question by:psteph
1 Comment
 
LVL 3

Accepted Solution

by:
sailwind earned 50 total points
ID: 1222004
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now