谷歌浏览器拖动链接:我想个关于JAVA编程的问题在程序中的this.repaint();有什么作用?startCallNum+=1;是什么意思?

来源:百度文库 编辑:高考问答 时间:2024/05/08 17:39:29
import javax.swing.*;
import java.awt.*;

public class MyAppletTwo extends JApplet
{
int initCallNum=0;
int startCallNum=0;
int stopCallNum=0;
int destroyCallNum=0;
int paintCallNum=0;


public void init()
{
initCallNum=initCallNum+1;
this.repaint();
}

public void start()
{
startCallNum+=1;
this.repaint();

}

public void stop()
{
stopCallNum+=1;
this.repaint();
}

public void destroy()
{
destroyCallNum+=1;
this.repaint();
}

public void paint(Graphics g)
{
paintCallNum+=1;

g.drawString("Start Meth Call Num Is :"+String.valueOf(startCallNum),20,50);

}
}