I have created a simply login screen for a test game and it plays a .mid music tune. The .wav sounds are played when you hover over a button. When I Build+Compile the program, the both sounds play inside netbeans. When i run the .jar file outside of netbeans, it does not work. Any suggestions…
P.S. The sounds are in a folder, inside the src folder, called resources. For .mid music, I use the sequence, and for .wav I use AudioInputStream and such.
It is most likely that you are attempting to access application resources as though they were a
File. An application resource would usually be inside a Jar file, and must be accessed byURL. To form the URL, use something like:If that is not the case, then the next most likely problem is that the resource is not being included in the Jar.