Yes, Eclipse makes you do a special import thing rather than just drag and drop.
I am so confused right now. The file acts like it is corrupted. However it is not because it will play in anything...
Type: Posts; User: DusteroftheCentury
Yes, Eclipse makes you do a special import thing rather than just drag and drop.
I am so confused right now. The file acts like it is corrupted. However it is not because it will play in anything...
Thanks. Although I dont think the wav file im using is corrupted. It works in any music player, just not using java.
Also, when I try to run the new jar file using the import method to import the...
Thank you so much guys! I tested it on a new .wav file and it does play in a loop! (It is a very short file and after playing more times than I can count, about 3 mins it stopped. Im guessing Java...
Im using Java SE 6 update 30, and I have no idea what you mean about different wave files.
Thanks for helping.
-Duster
Argh.
It must be something wrong on my side. When i use the EXACT SAME CODE, it runs for about 30 secs then stops. What could be wrong with my computer? :confused:
-Duster
What is the correct code for the other method of making an ImageIcon? I tried
URL pic = TestClass.class.getResource("PBn'J.gif");
panel.add(new JLabel(pic));
(It seemed to be the most obvious...
Wait...
I tried to edit my your code to get what I want from mine (minus the button because it is not needed), and got the same issue... Ittl play for about 30 secs then stop. This didnt happen...
Ok first of all,
Thank.You.So.Much.
I tested your code and it does work. It plays the audio how I would want it. I cant see what the differences between it and my code that make it work or not...
Wait...
Forget the resource thing for now, when I run it it plays for about 30 seconds- then stops and does not loop. The full file is 1:45 long.
Does this have something to do with the AudioClip...
Thanks again for your continued help. So I found out that it does work outside of Eclipse but only with the resource files in the same folder. When I try to export the files into the jar, it can't...
THANK YOU SO MUCH. YOU WERE SO HELPFUL! It works! It works! But only in Eclipse... What options do I check when exporting the jar to make sure it will work outside of Eclipse?
The .wav and .gif...
So drag the resources in next to the code? In the src folder?
Or just in the project folder next to the src folder?
Edit: I tried putting them in both places, didnt work :confused:
Also tried...
Do I add the .wav into the jar?
If so how? (If possible using Eclipse)
Could you put the code for detecting if the url is valid? Or do I just check?
Thx for helping.
-Duster
Ok. I know how to do printlns but what do I add to them to make them debug? Also- When I run it outside of Eclipse, with it in the same folder as the music and pictures etc., it'll just give me what...
Hey guys,
I am new to Java and am working on a fun little program. It's kinda pointless, but its to teach me the concepts.
Anyway, This is my code:
import javax.swing.*;
import...