0

I want to add a progress bar in j2me application that shows the busy process.

I am doing this using alert adding gauge as indicator but it disappears on button click.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Andy
  • 643
  • 5
  • 17

2 Answers2

1

If you do not want to go with LCDUI Alert or LWUIT you can use Canvas. I have shared a very simple sample at http://smallandadaptive.blogspot.com.br/2009/09/adding-simple-progress-bar.html Full text below:

A progress bar is a visual representation of a Real Number between zero and one or a percentage between 0% and 100%.

Below is a method for drawing a simple progress bar:


    /**
     * @param g Graphics
     * @param x
     * @param y
     * @param w width
     * @param h height
     * @param p part between zero and total
     * @param t total
     */
    void fillProgressBar (Graphics g, int x, int y, int w, int h, int p, int t) {
      g.drawRect(x, y, w, h);
      // p will receive the pixel width of the proportion: part / total
      p = (p * w) / t;
      g.fillRect(x, y, p, h);
    }

Telmo Pimentel Mota
  • 4,033
  • 16
  • 22
0

from LWUIT we can show progress in 2 ways

1) Displaying some gif image in a dialog and dont dispose dialogue until we get complete response from server / dispose it after complete processing

2) From LWUIT 1.5 we have component called Slider and Sliderfull , we can use that componet to show some progress until processing is done.

for further info please go through this blog Slider

Vijay YD
  • 514
  • 1
  • 4
  • 15