init -》 start -》 stop -》 destroy
测试代码:
import java.applet.*;
public class T1 extends Applet{
@Override
public void destroy() {
// TODO Auto-generated method stub
super.destroy();
System.out.println("destroy");
}
@Override
public void init() {
// TODO Auto-generated method stub
super.init();
System.out.println("init");
}
@Override
public void start() {
// TODO Auto-generated method stub
super.start();
System.out.println("start");
}
@Override
public void stop() {
// TODO Auto-generated method stub
super.stop();
System.out.println("stop");
}
}
测试结果·:
失去焦点时,调用stop方法,如最小化applet viewer