您所在的当前位置: 计算机等级考试题库   >  
JAVA题库  
  >  [填空题] 通过参数定制Applet,请在下划线处编写适当语句工 【15】 ,使程序能正确运行。 para_duke.html <HTML> <HEAD> <TITLE> A Simple Program </TITLE> </HEAD> <BODY> <applet code = DrawAny.class width = 100 height = 100 align = bottom> <param name = image value = "duke.gif"> </applet> </BODY> </HTML> DrawAny.java import java.awt.*; import java.applet.*; import java.net.URL; public class DrawAny extends Applet Image im; public void init() URL url = getDocumentBase(); String imageName = getParameter("image"); public void paint(Graphics g) g.drawImage(im,0,0,this);
问题:
发布时间:2022-07-01

[填空题] 通过参数定制Applet,请在下划线处编写适当语句工 【15】 ,使程序能正确运行。
para_duke.html
<HTML>
<HEAD>
<TITLE> A Simple Program </TITLE>
</HEAD>
<BODY>
<applet code = DrawAny.class width = 100 height = 100 align = bottom>
<param name = image value = "duke.gif">
</applet>
</BODY>
</HTML>
DrawAny.java
import java.awt.*;
import java.applet.*;
import java.net.URL;
public class DrawAny extends Applet

Image im;
public void init()

URL url = getDocumentBase();
String imageName = getParameter("image");

public void paint(Graphics g)

g.drawImage(im,0,0,this);

可能感兴趣的题目: