ΪʲôͬʱÔÚˮƽ´¹Ö±·½ÏòÍ϶¯Ê±»áÖØ»Á½´Î£¿Java¾¿¾¹ÊÇ°´ÔõôµÄ·½Ê½»´°ÌåµÄ?
import java.awt.*;public class Demo extends Frame
{
static int i=0;
Demo()
{
}
public void paint(Graphics g)
{
g.drawString("Drawing in Frame",30,80);
System.out.println("Test :"+i++);
}
}
class mainApp
{
public static void main(String[] args)
{
Demo fm=new Demo();
fm.setSize(200,200);
fm.setVisible(true);
}
}