import javax.microedition.lcdui.*; public class canvas extends Canvas implements Runnable{ public Boolean screen; public int pointX; public int pointY; public int pressed; public int released; public String state; public canvas(){ super(); screen = false; setFullScreenMode(screen); Area area = new Area(width()/2,width()/2,"THIS IS TEST"); Thread thread = new Thread(this); thread.start(); } public void run(){ while(true){ repaint(); try{ Thread.sleep(20); } catch ( InterruptedException e ) {} if (area.press(pointX,pointY)== true) { Main.midlet.destroyApp(true); } } } public void paint(Graphics g){ area.setPosition(0,height()/2); area.setColor(255,0,50); area.draw(g); } public void pointerPressed(int x, int y){ pointX = x; pointY = y; state = "pressed"; } public void pointerDragged(int x, int y){ pointX = x; pointY = y; state = "dragged"; } public void pointerReleased( int x, int y){ pointX = x; pointY = y; state = "released"; } public void keyPressed(int key){ pressed = key; } public void keyReleased(int key){ released = key; } }