I'd like to display a form with a simple text as "Connecting..." during an internet connection so that the user doesn't panic.
I tried using a Canvas and the paint method but nothing is displayed on my Nokia n70 before the paint method returns :
Do you have any idea on how to do that ? Is there an abstract method "OnShow" in the Form class ?
public class WaitForm extends Canvas implements CommandListener
private MyMIDlet midlet;
private MainMenu mainmenu;
private Command backCmd;
public WaitForm(MyMIDlet midlet, MainMenu mainmenu)
this.midlet = midlet;
this.mainmenu = mainmenu;
backCmd = new Command(mainmenu.langue.back, Command.STOP, 1);
public void commandAction(Command cmd, Displayable d)
if( cmd == backCmd)
protected void paint(Graphics g)
g.drawString("Connecting...", 0, 0, Graphics.TOP|Graphics.LEFT);
mainmenu.Connect(); // Take some times....