import javax.microedition.lcdui.*; class Louend3 extends Canvas{ int x, y; protected void paint(Graphics g){ g.setColor(255, 255, 255); g.fillRect(0, 0, getWidth(), getHeight()); g.setColor(0, 0, 0); g.drawRect(x-5, y-5, 10, 10); } protected void keyPressed(int kood){ if(getGameAction(kood)==Canvas.LEFT){x--;} if(getGameAction(kood)==Canvas.RIGHT){x++;} repaint(); } public void showNotify(){ x=getWidth()/2; y=getHeight()/2; } }