wood burning stoves 2.0*
The moose likes Java Micro Edition and the fly likes Real time progress bar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Real time progress bar" Watch "Real time progress bar" New topic

Real time progress bar

Octavian Miu

Joined: May 22, 2009
Posts: 8
hello! i m trying to make a real time progress bar, by that you guys must understood that i want the bar to load as the activity i am waiting for is loadign itself. Please help.
Octavian Miu

Joined: May 22, 2009
Posts: 8
can anyone please help me?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15959

I don't thing the standard J2ME widget toolset includes a progress bar, although maybe a third-party package like Polish might.

If you don't have a progress control, you can always do it the old-fashioned way. Draw a rectangle to hold the bar, draw another rectangle to show percent complete, where the width of this inner rectangle is W*(pct/100), where W is the width of the outer rectangle, and "pct" is the (integral) percent figure, as in "50" for 50%.

Customer surveys are for companies who didn't pay proper attention to begin with.
Octavian Miu

Joined: May 22, 2009
Posts: 8
thank you for the answer, but i ment to say another thing. i know how to do it regarding the graphic part. the problem is:
i have this midlet which is about 200kb and the user needs to wait a while until the midlet is loading so i lunch first this waiting screen with progress bar, the progres bar must represent the loading progress in real time, until my main screen is loaded. i want to represent the real progress, not a imaginary progress
Darryl Burke

Joined: May 03, 2008
Posts: 4523

First off, your application/MIDlet can't show a Gauge or other kind of progress bar while it is itself loading, it has to be already loaded and running for that.

For examples of the principles behind animation during long running tasks, see these two pages:
Networking, User Experience, and Threads
Using Threads in J2ME Applications

luck, db
There are no new questions, but there may be new answers.
Octavian Miu

Joined: May 22, 2009
Posts: 8
ok, but if i want to display a screen that takes time, what then?
I agree. Here's the link: http://aspose.com/file-tools
subject: Real time progress bar
Similar Threads
How to integrate progress bar between servlet and actionclass
Progress Bar
progressbar in real time and streams
Jasper Reports using AJAX
OutputStream implementation