If you are getting this Exception
.\MouseEvent.java:8: error: class Mouse is public, should be declared in a file named Mouse.java
public class Mouse extends Applet
Then you have to save you java file with name Mouse.java
or remove the public
declaration from class Mouse
.
Another Problem I see here
public void windowClosing(WindowEvent we) {
m.setVisible = false;// error
}
It should be m.setVisible(false);
One more problem is at your cunstructor
Mouse(String mj) {
super(mj);
addWindowListener(new mywa(this));
addWindowListener(this);//error , Parameter should be a WindowListener object
setSize(500, 500);
setVisible(true);
}