import javax.microedition.lcdui.*; public class Point extends Canvas implements Runnable{ private int pointX, pointY; private String state; public Point(){ super(); setFullScreenMode(true); pointX = -1; pointY = -1; state = "released"; Thread t = new Thread(this); t.start(); } public void run(){ repaint(); try{ Thread.sleep(20); }catch ( InterruptedException e ) {} } public void paint(Graphics g){ g.setColor(0x82e00); g.fillRect(0,0,getWidth(),getHeight()); g.setColor(0x000000); g.drawString ("x:"+pointX +",y:"+ pointY+ ",state:"+ state,10,10, Graphics.TOP| Graphics.LEFT); } public void pointerPressed(int x, int y){ repaint(); pointX = x; pointY = y; state = "pressed"; } public void pointerDragged(int x, int y){ repaint(); pointX = x; pointY = y; state = "dragged"; } public void pointerReleased( int x, int y){ repaint(); pointX = x; pointY = y; state = "released"; } }