java applet小程序显示未初始化,怎么办 5
程序如下:importjava.awt.Graphics;importjava.applet.Applet;publicclasshuapplet{publicclass...
程序如下:
import java.awt.Graphics;
import java.applet.Applet;
public class huapplet{
public class huApplet extends Applet{
public void paint(final Graphics g){
g.drawString("***",0,15);
g.drawString("****",0,30);
g.drawString("*****",0,45);
}
}
}
html:
<html>
<body>
<applet code=huapplet.class width=200 height=200>
</applet>
</body>
</html> 展开
import java.awt.Graphics;
import java.applet.Applet;
public class huapplet{
public class huApplet extends Applet{
public void paint(final Graphics g){
g.drawString("***",0,15);
g.drawString("****",0,30);
g.drawString("*****",0,45);
}
}
}
html:
<html>
<body>
<applet code=huapplet.class width=200 height=200>
</applet>
</body>
</html> 展开
1个回答
展开全部
import java.awt.Graphics;
import java.applet.Applet;
public class huapplet{
public class huApplet extends Applet{
public void init(final Graphics g){
g.drawString("***",0,15);
g.drawString("****",0,30);
g.drawString("*****",0,45);
}
}
}
html:
<html>
<body>
<applet code=huapplet.class width=200 height=200>
</applet>
</body>
</html>
这样试试.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询