import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Moumot2 extends JFrame implements MouseListener, MouseMotionListener {
public Moumot2()
{
addMouseMotionListener(this );
addMouseListener( this );
setSize(400,300);
setVisible(true);
}
public void mouseDragged(MouseEvent e)
{
setTitle("Mouse Dragged");
}
public void mouseMoved( MouseEvent event )
{
setTitle("Mouse Moved");
}
public void mouseClicked( MouseEvent event )
{
setTitle("Mouse Clicked");
}
public void mouseReleased( MouseEvent event )
{
setTitle("Mouse Released");
}
public void mouseEntered( MouseEvent event )
{
setTitle("Mouse Entered");
}
public void mouseExited( MouseEvent event )
{
setTitle("Mouse Exited");
}
public void mousePressed( MouseEvent event )
{
setTitle("Mouse Pressed");
}
public static void main(String args[])
{
Moumot2 bt = new Moumot2();
bt.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );
}
}