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

public class Dots2 extends Applet implements MouseListener {

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

    private Point point0 = null;

    public void init() {
	addMouseListener( this );
	setBackground( Color.black );
	setSize( APPLET_WIDTH,APPLET_HEIGHT );
    } // end of init()

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

    public void setPoint( Point point ) {
	point0 = point;
    } // end of setPoint()

    public void mouseClicked( MouseEvent evt ) {
	Point point0 = evt.getPoint();
	setPoint( point0 );
	repaint();
    } // end of mouseClicked()

    public void mousePressed( MouseEvent evt ) {
    } // end of mousePressed()

    public void mouseReleased( MouseEvent evt ) {
    } // end of mouseReleased()

    public void mouseEntered( MouseEvent evt ) {
    } // end of mouseEntered()

    public void mouseExited( MouseEvent evt ) {
    } // end of mouseExited()

} // end of Dots2 class
