import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;

public class Dots5 extends Applet implements KeyListener {

    private final int APPLET_WIDTH = 200;
    private final int APPLET_HEIGHT = 200;
    private final int RADIUS = 6;

    private Point point0 = null;

    public void init() {
	addKeyListener( this );
	setBackground( Color.black );
	setSize( APPLET_WIDTH,APPLET_HEIGHT );
	point0 = new Point( 100,100 );
    } // end of init()

    public void update( Graphics g ) {
	g.setColor( Color.cyan );
	if ( point0 != null ) {
	    g.fillOval( point0.x-RADIUS,point0.y-RADIUS,RADIUS*2,RADIUS*2 );
	}
    } // end of update()

    public void keyPressed( KeyEvent evt ) {
	switch ( evt.getKeyCode() ) {
	case KeyEvent.VK_UP:
	case KeyEvent.VK_U:
	    point0.y--;
	    break;
	case KeyEvent.VK_DOWN:
	case KeyEvent.VK_D:
	    point0.y++;
	    break;
	case KeyEvent.VK_LEFT:
	case KeyEvent.VK_L:
	    point0.x--;
	    break;
	case KeyEvent.VK_RIGHT:
	case KeyEvent.VK_R:
	    point0.x++;
	    break;
	}
	repaint();
    } // end of keyPressed()

    public void keyTyped( KeyEvent evt ) {
    } // end of keyTyped()

    public void keyReleased( KeyEvent evt ) {
    } // end of keyReleased()

} // end of class Dots5
