import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Mou extends JFrame {
public Mou()
{
super("BUTTON TEST");
addMouseListener( new MouseClickHandler());
setSize(200,300);
setVisible(true);
}
public static void main(String args[])
{
Mou bt = new Mou();
bt.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );
}
private class MouseClickHandler extends MouseAdapter{
public void mouseClicked(MouseEvent e)
{
JOptionPane.showMessageDialog(null,"Mouse clicked");
repaint();
}
}
}