i'm programming on frame and applet window but problem is that,the code not working. help me to solve this problem and also help me how to close frame window because with the help of window listener the frame window is not closing.
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
/*<applet code="fra1.class" height=500 width=600></applet>*/
public class fra1 extends Applet implements WindowListener
{
String msg="This is applet window";
Frame f;
public void init()
{
setLayout(null);
f=new Frame();
f.setTitle("THE JAVA GAMER");
f.setSize(400,400);
f.setVisible(true);
f.add(new Label("This is frame window"),Label.LEFT);
f.addWindowListener(this);
}
public void start()
{
f.setVisible(true);
}
public void stop()
{
f.setVisible(false);
}
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
public void paint(Graphics g)
{
g.drawString(msg,100,100);
}
}
and giving me this error again and again:
fra1 is not abstract and does not override abstract method windowdDeactivated
(java.awt.event.windowEvent) in java.awt.event.WindowListener public class
fra1 extends Applet implements WindowListener