help with MIDP's setCurrent
ok, I have the simple program following this code. I had expected it to print "1", paint canvas1, print "2" and then paint canvas2. However, it just prints "1" and then hangs. It doesnt paint canvas1. Obviously I dont understand something about setCurrent(), but i've been scanning on the net and cant fingure out whats wrong.
Please CC me at dneiss@qualcomm.com Thanks.
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class test extends MIDlet implements Runnable
{
public void destroyApp(boolean b)
{System.out.println("destroyApp");}
public void pauseApp()
{System.out.println("pauseApp");}
public void startApp()
{
new Thread(this).start();
}
public void run()
{
Canvas c1,c2;
c1 = new canvas1();
c2 = new canvas2();
System.out.println("1");
Display.getDisplay(this).setCurrent(c1);
System.out.println("2");
Display.getDisplay(this).setCurrent(c2);
}
}
class canvas1 extends Canvas
{
public void paint(Graphics g)
{
g.drawLine(0,0,100,100);
}
}
class canvas2 extends Canvas
{
public void paint(Graphics g)
{
g.drawLine(0,100,100,0);
}
}

