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

public class FareTesti extends Applet
implements MouseListener, MouseMotionListener
{
 private int nx,ny=-10;
 private String s="";

 public void init()
 {
 addMouseListener(this);
 addMouseMotionListener(this);
 }

 public void paint(Graphics g)
 {
 g.drawString(s+"["+nx+","+ny+"]",nx,ny);
 }

 public void degerleriGir(String e,int x,int y)
 {
 s=e;
 nx=x;
 ny=y;
 repaint();
 }

 //fare dinleyicisinin dinledikleriyle ilgili cikti metodlari
 public void mouseClicked(MouseEvent e)
 { degerleriGir("Kliklendi",e.getX(),e.getY()); }
 public void mousePressed(MouseEvent e)
 { degerleriGir("Basildi",e.getX(),e.getY()); }
 public void mouseReleased(MouseEvent e)
 { degerleriGir("Birakildi",e.getX(),e.getY()); }
 public void mouseEntered(MouseEvent e)
 { showStatus("Fare applet alani icinde"); }
 public void mouseExited(MouseEvent e)
 { showStatus("Fare applet alani disinda"); }
 //MouseMotionListener (fare hareket dinleyicisi) metotlari
 public void mouseDragged(MouseEvent e)
 { degerleriGir("basilip cekiliyor",e.getX(),e.getY()); }
 public void mouseMoved(MouseEvent e)
 { degerleriGir("hareket halinde",e.getX(),e.getY()); }

}
