Playing music in applications

I keep getting the Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space

The error is at runtime.

Here is the music code:

publicvoid startthemusic()

{

whatmusic ="wae.wav";

playmusic();

}

publicvoid playmusic()

{

try

{

URL hapfile =new URL("file:sounds/hap.wav");

AudioClip hap = JApplet.newAudioClip(hapfile);

URL waefile =new URL("file:sounds/wae.wav");

AudioClip wae = JApplet.newAudioClip(waefile);

if(whatmusic =="hap.wav")

{

wae.stop();

hap.loop();

}

elseif(whatmusic =="wae.wav")

{

hap.stop();

wae.loop();

}

}

catch(MalformedURLException error)

{

System.out.println("Music Error");

}

}

What is the problem?

[1683 byte] By [Chris1234554a] at [2007-11-27 5:41:29]
# 1
If you are executing a large file (above 50 MB) then only this error ill be come because default java is allocated 64 mb memory only for programsorun your program with memory argument java -Xmx200m YourProgram http://javasolution.blogspot.com
Arunssofta at 2007-7-12 15:19:01 > top of Java-index,Security,Cryptography...