haoshuang3394 发表于 2013-2-5 01:27:53

The Quintessential Applet

<script>function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}</script>
Every applet must subclass Applet.
import java.applet.*;
import java.awt.*;
public class BasicApplet extends Applet {
public void init() {
// Called once by the browser when
// it starts the applet.
}
public void start() {
// Called whenever the page containing
// this applet is made visible.
}
public void stop() {
// Called whenever the page containing this
// applet is not visible.
}
public void destroyed() {
// Called once when the browser destroys
// this applet.
}
public void paint(Graphics g) {
// Called whenever this applet needs to
// repaint itself.
}
}
This isthe applet's accompanying HTML file.

<applet code=BasicApplet width=100 height=100>
</applet>
页: [1]
查看完整版本: The Quintessential Applet