Methods Summary |
---|
public void | destroy()Called from the Browser (when the applet is being un-cached?).
Not actually used here, but the println will show when it's called.
System.out.println("In AppletMethods.destroy()");
|
public java.lang.String | getParameter(java.lang.String p, java.lang.String def)An alternate form of getParameter that lets
you provide a default value, since this is so common.
return getParameter(p)==null?def:getParameter(p);
|
public void | init()Initialize the sound file object and the GUI.
System.out.println("In AppletMethods.init()");
try {
snd = getAudioClip(new URL(getCodeBase(), "laugh.au"));
} catch (MalformedURLException e) {
showStatus(e.toString());
}
setSize(200,100); // take the place of a GUI
|
public void | paint(java.awt.Graphics g)
g.drawString("Welcome to Java", 50, 50);
|
public void | start()Called from the Browser when the page is ready to go.
System.out.println("In AppletMethods.start()");
if (snd != null)
snd.play(); // loop() to be obnoxious...
|
public void | stop()Called from the Browser when the page is being vacated.
System.out.println("In AppletMethods.stop()");
if (snd != null)
snd.stop(); // stop play() or loop()
|