Methods Summary |
---|
public void | actionPerformed(java.awt.event.ActionEvent event)
//PLAY BUTTON
Object source = event.getSource();
if (source == Play) {
//Try to get the AudioClip.
onceClip = soundList.getClip(wavFile);
onceClip.play(); //Play it once.
showStatus("Playing sound " + wavFile + ".");
if (onceClip == null) {
showStatus("Sound " + wavFile + " not loaded yet.");
}
return;
}
|
protected java.net.URL | getURL(java.lang.String filename)
URL codeBase = getCodeBase();
URL url = null;
try {
url = new URL(codeBase, filename);
} catch (java.net.MalformedURLException e) {
System.err.println("Couldn't create image: badly specified URL");
return null;
}
System.out.println("url "+url);
return url;
|
public void | init()
URL pict_button_URL = getURL(rocket);
pb_Icon = new ImageIcon(pict_button_URL);
Play = new JButton(pb_Icon);
Play.addActionListener(this);
JPanel controlPanel = new JPanel();
controlPanel.add(Play);
getContentPane().add(controlPanel);
startLoadingSounds();
|
void | startLoadingSounds()
//Start asynchronous sound loading.
soundList = new AppletSoundList(this, getCodeBase());
soundList.startLoading(wavFile);
|