• Post Reply Bookmark Topic Watch Topic
  • New Topic

ProgressBar in java  RSS feed

 
Vyom Sharma
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you using to write your mini IDE? Swing?
 
Paul Clapham
Sheriff
Posts: 22823
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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.
 
Guillermo Ishi
Ranch Hand
Posts: 789
C++ Linux Python
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 22823
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!