Java Applet 编程全解析
1. SayWhatApplet 参数差异示例
SayWhatApplet 每次参数不同时运行结果会不同。以下是 saywhat3.html 的代码,它让 SayWhatApplet 显示 “You’re thrashing all around!”:
<html>
<head>
<title>Say What Applet 3</title>
</head>
<body>
<h1 align=center>Say What Applet 3</h1>
<center>
<applet code="SayWhatApplet.class" width=300 height=100>
<param name="say" value="You're thrashing all around!">
</applet>
</center>
<body>
</html>
参数改变后,运行结果可查看对应图示。
2. 在 Applet 中使用 Frames
可以在 Java applet 中调用 Frames。它与普通 Frames 类似,但底部有警告,提醒用户这是 applet 而非应用程序,可能不太可靠。不过,applet 有安全限制,无法随意操作硬盘,无需过度担忧。若信任 applet,也可给予其访问计算机的权限。
以下是 FrameTe