Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

progressbar

Posted on 1998-08-17
1
168 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Protect jar file - windows app 2 65
web services creation SOAP vs REST 5 57
tomcat administrtor 12 61
Java program running SQL query 5 37
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This video teaches viewers about errors in exception handling.
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.

828 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