/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; public class SoundApplet extends Applet { public void init() { // Take out this line if you don't use symantec.itools.net.RelativeURL or symantec.itools.awt.util.StatusScroller symantec.itools.lang.Context.setApplet(this); // This code is automatically generated by Visual Cafe when you add // components to the visual environment. It instantiates and initializes // the components. To modify the code, only use code syntax that matches // what Visual Cafe can generate, or Visual Cafe may be unable to back // parse your Java file into its visual environment. //{{INIT_CONTROLS setLayout(null); setSize(298,133); button1.setLabel("Click for Chord"); add(button1); button1.setBackground(java.awt.Color.lightGray); button1.setBounds(84,36,111,35); //}} //{{REGISTER_LISTENERS SymAction lSymAction = new SymAction(); button1.addActionListener(lSymAction); //}} } //{{DECLARE_CONTROLS java.awt.Button button1 = new java.awt.Button(); //}} class SymAction implements java.awt.event.ActionListener { public void actionPerformed(java.awt.event.ActionEvent event) { Object object = event.getSource(); if (object == button1) button1_ActionPerformed(event); } } void button1_ActionPerformed(java.awt.event.ActionEvent event) { AudioClip sound = getAudioClip(getDocumentBase(),"E7.wav"); sound.play(); } }