第一个错误应该有一个参数吧Graphics g=new Graphics(参数);
catch (InterruptException e){ 应该把括号去掉吧catch InterruptException e{//
g.setColor (Color.red());应该是 g.setColor (Color.red);吧
catch (InterruptException e){ 应该把括号去掉吧catch InterruptException e{//
g.setColor (Color.red());应该是 g.setColor (Color.red);吧
用Graphics g=null;
三.g.setColor (Color.red);
应该这样 Graphics g=Graphics.create();
或者 使用有参的create(int x, int y, int width, int height)
因为public abstract class Graphics g.setColor (Color.red());//此行有错
应该直接引用,Color.Red 因为:public static final Color RED
catch (InterruptException e){//此行有错
System.out.println(e);
}
public class InterruptedException
extends Exception Thrown when a thread is waiting, sleeping, or otherwise paused for a long time and another thread interrupts it using the interrupt method in class Thread