你是不是用的是java命令,而不是用applet方式.用appletview命令.或者用浏览器方式.

解决方案 »

  1.   

    编写一个简单的html文件a3.html,内容如下:
    <html>
    <body>
    <applet width="400",height="200",code="a3.class"></applet>
    </body>
    </html>
    然后执行命令:
    appletviewer a3.html
    就可以看到结果了。
      

  2.   

    stamp80的方法appletviewer 没有看到预期的结果
    friendsk的方法也同样,只显示出一个灰色的区域
    是什么原因呢
      

  3.   

    因为你的代码里少了一句:super.paint(g);放在switch(x+y)前面