日期:2014-05-20  浏览次数:20748 次

图片显示的问题
问大家一个问题,
import       java.applet.*;
import       java.awt.*;
public         class   Test   extends       Applet
{           private       Image       a;
              public         void       init()
              {       a=getImage(getDocumentBase(), "a.gif ");
              }
             
              public   void   paint(Graphics   g)
              {
              g.drawImage(a,0,0,this);
              }
}
图片显示不出来呀,应该怎样设置我的图片呀。

------解决方案--------------------
<html>
<read>
<title> "例子 " </title>
</read>
<body>
<applet code = Test.class width = 400 height = 400>
</applet>
</body>
</html>

保存在程序同一目录下,为任意文件名.html 试试