• 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

ProgressBar in java

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey..

I am developing a mini Java IDE to write and compile java programs on a click without the need of much complex Editors for beginners.

I need to add a progress bar as a program compiles but I am unable to program in such a way that its progress is controlled by the actual compilation time.

Please help me in dealing with it.

Thank you
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are you using to write your mini IDE? Swing?
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And what did you mean by having the progress bar "controlled by the actual compilation time"? The way I read that, the actual compilation time -- if that refers to the elapsed time -- isn't known until after it's all finished, so it's hard to use that to control anything. But if you wanted to use the time when compilation took place -- like for example the compilation took place at 9:33 AM -- then I don't know what that could mean either.
 
Ranch Hand
Posts: 789
Python C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think a progress bar is appropriate there. Because you'd have to fake one. If you had to fake one, you might fill the bar halfway after you've read the files, and then after the compile display it filled just long enough to notice it.

But you shouldn't do that. The best thing would be to have an output window where you display "compiling..." and then scroll it up and display "Done." Mainly you need to let them know it's finished, and before then that it's started and also isn't hung up.

Something else you could do like what PKZip used to do, which was during the processing add a dot every second or so. So it might start off "Compiling.." and at the end it would say "Compiling........" and then send a newline and "Done". That lets the user know it's started, and isn't hung up. It's sort of like an open-ended progress bar if you follow. Progress bar without a defined end point.
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know whether this is the actual question underlying the original post, but the Oracle tutorial about Swing progress bars says this:

Sometimes you can't immediately determine the length of a long-running task, or the task might stay stuck at the same state of completion for a long time. You can show work without measurable progress by putting the progress bar in indeterminate mode.

reply
    Bookmark Topic Watch Topic
  • New Topic