Set the path for the location of media files in program

Posted by Zaheer Boovaji on Stack Overflow See other posts from Stack Overflow or by Zaheer Boovaji
Published on 2012-09-08T08:52:55Z Indexed on 2012/09/08 9:38 UTC
Read the original article Hit count: 208

Filed under:
|
|

I have made a Java Swing Desktop application in Netbeans which can play media files I have put the videos in my workspace resources location and in my java program I am calling those media files using an URL which is something like this:

C:/users/Dell/My Documents /NetBeansProjects/Media/src/resources/ MediaFiles/ddd.mpg

This works well when I run in my IDE and also i have made Jar for this it works well on my computer but the problem is when i copy this jar file on my friends system the interface is coming but when I click a button to play a media file it says:

C:/users/Dell/MyDocuments/NetBeansProjects/Media/src/resources/ MediaFiles/ddd.mpg 

does not exist

So, please provide me a solution of how to set the default path so that when I run a jar file on other systems it should play the media file location I am passing as in my program.

How to set the path for the location of media files in program?

Update

The videos are in the jar file.

© Stack Overflow or respective owner

Related posts about java

Related posts about swing