题目详情
当前位置:首页 > 计算机考试 > 初级程序员
题目详情:
发布时间:2023-12-17 03:39:39

[简答题][说明] 当用户启动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>

更多"[说明] 当用户启动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>

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码