📄 myapplet.java
字号:
/*
* Created on 2007-9-23
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
import java.awt.*;
import java.awt.Graphics;
import java.applet.Applet;
/**
* @author Administrator
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class MyApplet extends Applet
{
Label label;
public void init()
{
label=new Label();
setSize(400,300);
System.out.println("Applet is inited!");
label.setText(label.getText()+"Applet is inited!");
}
public void stop()
{
System.out.println("Applet is stopped!");
label.setText(label.getText()+"Applet is stopeed!");
}
public void start()
{
System.out.println("Applet is started!");
label.setText(label.getText()+"Applet is started!");
}
public void destroy()
{
System.out.println("Applet is destroyed!");
label.setText(label.getText()+"Applet is destroyed!");
}
public void paint(Graphics g)
{
g.drawString(label.getText(),10,10);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -