title: How do you use getDocumentBase() and getCodeBase() correctly in Java Applets?
body: <p>I am working on a project, and I'm new to applets. I don't know how to find a file using these arguments. I know there is another question out there that is almost the same, but I want this in an easy, simplified way because I'm new to this. Any help would be awesome!!! Here is my code:</p>
  
  <pre><code>import java.applet.Applet;
  import java.applet.AudioClip;
  import java.awt.Graphics;
  
  public class SoundDemo extends Applet
  {
  public void init()
  {
  AudioClip clip = getAudioClip( getCodeBase(), "sounds/Dragon Roost.wav" );
  clip.play();
  }
  
  public void paint( Graphics g )
  {
  g.drawString( "Now Playing Clip", 10, 10 );
  }
  </code></pre>
  
  <p>}</p>