I am making a card game, and it's almost done. The last thing I want to do is play some background music. Now if I copy the file into the default package and make a single jar file of the game, will the music play on all computers? Currently, on my PC it's running without any problem by giving a specific path for the file like "C:\\samp.wav";
. But I am worried that if I make a jar file and run it on another PC it won't work properly. I think there will be a FileNotFoundException
. Am I right or wrong?
For the card's image I am using this line:
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/1.jpg")));
Those pictures I have inserted into my default package. I want to do the same for the music file, but how? I am using NetBeans.