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

From: Bo (snarlly_at_hotmail.com)
Date: 03/29/04


Date: 28 Mar 2004 19:08:52 -0800

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 );
}
...



Relevant Pages

  • Re: How do I program this?
    ... all it does is launch a web browser that goes to a specific ... just saving a ".html" file is that I want to customize the icon. ... void main ... (this one is 53Kb, /without/ any additional resources). ...
    (comp.programming)
  • How to use CeCreateProcess for launching an application in PPC?
    ... I create an easy dialog based MFC application, I propose to launch an ... void CAppDlg::OnOK ... Raul. ...
    (microsoft.public.windowsce.app.development)
  • how to write a wrapper function?
    ... I am stuck:( ... (some OS call to launch a task): ... The compiler refuses it with the error, expecting *void cannot pass ... Can someone help out on how a wrapper function is used? ...
    (comp.lang.c)