阅读以下说明、Java代码和HTML文档,将应填入(n)处的字句写在对应栏内。
[说明]
当用户启动html浏览器并首次打开下面的html文档时,Java Applet小程序在第一个显示面板上显示字符串"HelloWorld";在第二个显示面板上画一条直线。
[Java代码]
import java.awt. *;
import javax.swing. *;
public class HelloWorldApplet extends JApplet
pubhc void (1) {
(2) str="HetloWorld";
JLabel label = new JLabel(str);
this. getContentPane().add(label);
}
}
import java.applet.Applet;
import java.awt.Graphics;
public class AppletPaint extends (3) {
public void paint( (4) ) {
g.drawLine(0,0,300,200);
}
}
[HTML文档]
<html>
<head>
<title> HTML Test Page </title>
</head>
<body>
<applet code="(5)" width="300" height="100">
</applet>
<applet code=" AppletPaint.class" width="300" height="100">
</applet>
</body>
</html>
订单号:
遇到问题请联系在线客服
订单号:
遇到问题请联系在线客服