• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Progress percentage of JProgressBar

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 79151
377
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Rancher
Posts: 1093
29
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Marshal
Posts: 28176
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's a pleasure
reply
    Bookmark Topic Watch Topic
  • New Topic