更多"[说明]
当用户启动html浏览器并首次打开下面的html文档时,"的相关试题:
[简答题][说明]
当用户启动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>
[填空题]java Applet应用程序的编写和执行共分为4步进行:编写源代码、编写HTML文件调用该小程序、 【13】 、解释执行.
[填空题]Java Applet应用程序的编写和执行共分编写源代码、编写HTML文件调用该小程序、______和解释执行四步进行。
[填空题]如果在Applet中要访问一个HTML文件,可以请示浏览器实现相应HTML文本的显示。通过AppletContext的 【13】 方法,Applet可以通知浏览器在哪个窗口中显示哪个URL中的文件。
[填空题]如果在Applet中要访问一个HTML文件,可以请求浏览器实现相应HTML文本的显示。通过AppletContext的【 】方法,Applet可以通知浏览器在哪个窗口中显示哪个URL中的文件。
[填空题]现在有Java Applet小程序的源程序文件MyApplet.java,编译后生成的字节码文件为MyApplet.class,对应的HTML文件为MyApplet.html。查看该小程序的运行结果两种方式:运行命令 【14】 ;直接用浏览器打开MyApplet.html文件。
[填空题][说明]
编写一个Applet程序,接受HTML文件传递的整数参数,根据该参数指定Applet中文本框的长度。编写对应的HTML文件运行这个Applet。
[Java 代码]
import java. applet.*;
import java. awt.*;
public class chuangdics extends (1) TextField tf=new TextField ( );
int tfLength=0;
public void init( )
try
tfLength=Integer. parseInt( (2) ("length"));
tf. setColumns (tfLength);
add (tf);
catch (NumberFormatException nfe)
tf. (3) ("HTML 文件传人的参数格式错误。");
add(tf);
[HTML 代码]
<html>
<head>
<title> (4) </title>
</head>
<body>
<hr>
<applet code=chuangdics width=700 height=150>
<param name=length value=20>
(5)
<hr>
</body>
</htmI>