Opening an mp3 file in the default external player.
Hi, i am having a problem opening an mp3 in the systems default player. I dont want the mp3 to be launched with the program but with the systems media player (e.g. vlc, windows media player, winamp etc whatever it may be)
here is the code i am currently using:
String tempFile = f.getAbsolutePath();
tempFile = tempFile.replaceAll("%20"," ");
File temp = new File(tempFile);
document = temp;
Desktop dt = Desktop.getDesktop();
dt.open(document);
the error i get is this:
java.io.IOException: Failed to open file:/C:/Users/matt/Documents/NetBeansProjects/theProject/test.mp3. Error message: Unspecified error
any suggestions? am i doing it wrong? been stuck on this for a solid hour now and google searching hasnt helped :( thx for any help :frusty: