java这段代码输出的applet小程序只有空白,没有文字,求解,代码如下
importjava.awt.Graphics;importjava.applet.Applet;publicclassHelloAppletextendsApplet{...
import java.awt.Graphics;
import java.applet.Applet;
public class HelloApplet extends Applet
{
public void main (Graphics g)
{
g.drawString("欢迎进入SCJP认证!",15,25);
}
}
html代码
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hello</title>
</head>
<body>
<hr>
<applet code="HelloApplet.class" width="400" height="450">
</applet>
</body>
</html> 展开
import java.applet.Applet;
public class HelloApplet extends Applet
{
public void main (Graphics g)
{
g.drawString("欢迎进入SCJP认证!",15,25);
}
}
html代码
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hello</title>
</head>
<body>
<hr>
<applet code="HelloApplet.class" width="400" height="450">
</applet>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询