代码如下,为啥每次执行都只会运行paint方法,该怎么解决才能运行main()的时候,run()里面调用paint()?
publicclassRacingHorseextendsAppletimplementsRunnable{publicvoidinit(){...}publicvoid...
public class RacingHorse extends Applet implements Runnable{
public void init(){ ...}
public void paint(Graphics g){ ...}
@Override
public void run() { ...}
public static void main(String[] arges){
new Thread(new RacingHorse()).start();
}
} 展开
public void init(){ ...}
public void paint(Graphics g){ ...}
@Override
public void run() { ...}
public static void main(String[] arges){
new Thread(new RacingHorse()).start();
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询