By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,852 Members | 2,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,852 IT Pros & Developers. It's quick & easy.

MIDP: "Select one to launch" screen always on top?

P: n/a
Bo
Hi

The rectangles I draw in paint() always hide underneath the "Select
one to launch" screen, while the string "Hello World" is drawn over
the "to launch" screen. What am I doing wrong?

jdk 1.4, midp 2.0

public class myCanvas extends Canvas{

....

void paint(Graphics g)
{
g.setColor(0xFF0000);
g.fillRect(0,0, getWidth(), getHeight() );
g.setColor(0x00FF00);
g.drawString("Hello World", getWidth()/2, 0, Graphics.HCENTER |
Graphics.TOP);
}
}

public class MIDLET extends MIDlet implements Runnable{

myCanvas canvas;
....

startApp()
{
canvas = new myCanvas();
Display.getDisplay(this).setCurrent( canvas );
thread = new Thread( this );
thread.start();
}

....

void run()
{
while( true ) {
canvas.repaint();
}
Thread.sleep( 200 );
}
....
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.