第一个错误应该有一个参数吧Graphics g=new Graphics(参数);
catch (InterruptException e){ 应该把括号去掉吧catch InterruptException e{//
g.setColor (Color.red());应该是 g.setColor (Color.red);吧

解决方案 »

  1.   

    InterruptException 有这异常吗??
      

  2.   

    Graphics g=new Graphics();//此行有错 
    用Graphics g=null;
      

  3.   

    Graphics是一个接口,不能直接new 一个对象
      

  4.   

    一.一楼的有错,Graphics类是不能实例化的
    三.g.setColor (Color.red);
      

  5.   

    Graphics g=new Graphics();//此行有错
      应该这样 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  
       
      

  6.   

    System.out.println(e);  好象也有错,e 应该e.GetMessage()  或者直接调用 e.printStackTrace();