import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class test extends JFrame implements MouseListener
{
JFrame f;
JPanel p;
JButton b;
test()
{
f=new JFrame("My Frame");
p=new JPanel();
f.add(p);
b=new JButton("Button");
p.add(b);
f.setSize(100,100);
f.setVisible(true);
b.addMouseListener(new MouseListener()
{
public void mouseClicked(MouseEvent ae)
{
System.out.print("mouse clicked");
}
});
b.addMouseListener(new MouseListener()
{
public void mouseEntered(MouseEvent ae)
{
System.out.print("mouse Entered");
}
});
b.addMouseListener(new MouseListener()
{
public void mouseExited(MouseEvent ae)
{
System.out.print("mouse Exited");
}
});
b.addMouseListener(new MouseListener()
{
public void mousePressed(MouseEvent ae)
{
System.out.print("mouse Pressed");
}
});
b.addMouseListener(new MouseListener()
{
public void mouseReleased(MouseEvent ae)
{
System.out.print("mouse Released");
}
});
}
public static void main(String args[])
{
new test();
}
}
Ошибки следующие:
--------------------Configuration: <Default>--------------------
C:\Users\SHUBHENDU\Documents\test.java:19: <anonymous test$1> is not abstract and does not override abstract method mouseExited(java.awt.event.MouseEvent) in java.awt.event.MouseListener
{
^
C:\Users\SHUBHENDU\Documents\test.java:26: <anonymous test$2> is not abstract and does not override abstract method mouseExited(java.awt.event.MouseEvent) in java.awt.event.MouseListener
{
^
C:\Users\SHUBHENDU\Documents\test.java:33: <anonymous test$3> is not abstract and does not override abstract method mouseEntered(java.awt.event.MouseEvent) in java.awt.event.MouseListener
{
^
C:\Users\SHUBHENDU\Documents\test.java:40: <anonymous test$4> is not abstract and does not override abstract method mouseExited(java.awt.event.MouseEvent) in java.awt.event.MouseListener
{
^
C:\Users\SHUBHENDU\Documents\test.java:47: <anonymous test$5> is not abstract and does not override abstract method mouseExited(java.awt.event.MouseEvent) in java.awt.event.MouseListener
{
^
5 errors