题目内容:
通过参数定制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); } }
参考答案:
答案解析: