📄 appletlifecircle.java
字号:
/**
*A applet life circle demostration program,pay more attention!
*2004.12.23. xhcprince
*/
import java.applet.Applet;
import java.awt.Graphics;
public class appletLifeCircle extends Applet
{
String s = "The ";
public void init()
{
s += "New "; //when init the applet!
System.out.println(s);
}
public void start()
{
s += "Applet "; //when the applet's inited or the applet window is activated from the minimized state!
System.out.println(s);
}
public void stop()
{
s += "Stops "; //when minimize the applet window!
System.out.println("Stops");
}
public void destroy()
{
s += "Here "; //when close the applet window!
System.out.println("Here");
}
public void paint(Graphics g)
{
g.drawRect(25,25,100,100);
s += "Draw "; //when the rectangle has been drawed
g.drawString(s,25,40);
}
}
/*
<applet code = "appletLifeCircle.class" width = 160 height = 160>
</applet>
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -