try
1.
import java.applet.Applet;
import java.awt.*;
import java.lang.*;public class MyApplet2 extends Applet
{  
String m_str;
public void init(){
  m_str="test";
 // resize(30,40);
}
    
public void paint(Graphics g)
{
  g.setColor(Color.red);
  g.drawString("now is the test ClassData:",10,20);
  g.drawString(m_str,10,40);
}
}2.
<html>
<body>
<applet code="MyApplet2.class" width="200" height="200">
</applet>
</body>
</html> 3. because IE might not have the latest JVM, use
c:\>AppletViewer yourhtml.html

解决方案 »

  1.   

    drawString("",0,0)显示在你看不到的地方,如果把 0,0 改为 0,50 肯定可以看到你输出的字符串。试试看.:)
      

  2.   

    还有把鼠标移到灰色区域,看看IE状态览的消息。你的html一定是说找不到你写的类。
    在html所在的路径下建一个XXX目录,然后
    <applet code="XXX.MyApplet2.class" width="200" height="200" codebase=".">
    那么现在应该可以看到想要的内容了。
      

  3.   

    g.drawString("now is the test ClassData:",0,0);  用50,50代替0,0看
      

  4.   

    原来是这样!~
    的确,有输出,只是我没看到!
    那我问一下,drawString中的x,y是以象素点为单位吗?
    还是字符行数