• Post Reply Bookmark Topic Watch Topic
  • New Topic

Progress percentage of JProgressBar  RSS feed

 
Sandun Suranga Wijenayaka
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When filling the Java progress bar, it is needed to indicate completed percentage in the middle of the progress bar. (as an example 15%).
How to do it with coding, without using an IDE.
 
Campbell Ritchie
Sheriff
Posts: 55358
157
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch
Please don't go round thinking you use different code on IDEs, although an IDE may generate its own code. As for showing the percentages, have you seen this tutorial?
 
Les Morgan
Rancher
Posts: 767
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using your IDE to auto code then stop it, stop it right now, and learn Java, it is actually easier and more reliable to do things manually than use the auto code generated by the IDE's.

Campbell Ritchie has given you a reference to a very good tutorial, take some time and go through it. It will make your life a lot easier in the coding world.

BTW: I started using NetBeans back in the late 90's and I have seen programmers get much, much more dead ends (completely unusable code), errors, and frustration in their projects than the
auto coders have ever helped. Do yourself a favor and get of the idea that you should ever use the auto coders as a shortcut or presume to develop any significant portion of your project with them.

sandun wijenayaka wrote:When filling the Java progress bar, it is needed to indicate completed percentage in the middle of the progress bar. (as an example 15%).
How to do it with coding, without using an IDE.
 
Paul Clapham
Sheriff
Posts: 22379
42
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As for how to write the code for a progress bar, that's a good question. If you google for java progress bar tutorial you should find this link: How to Use Progress Bars. It explains what they are, what kind of progress bars you can use, and (most importantly) how to code them. It comes with code examples, so you can start with an example which looks useful to you. Play around with the code in the example and then once you know how it works, extract the useful bits and put them into your own code.
 
Sandun Suranga Wijenayaka
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all... Campbell Ritchie's link is much helped me to understand how to use a JProgrssBar in different situations.
 
Campbell Ritchie
Sheriff
Posts: 55358
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a pleasure
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!