You can get a URL relative to where the your java class file is and refernce files in the same location. This is done using the the getResource() method of class. Place the resource in a folder called "resources" in the same position as your .class file. Then you can get a url relative to the position of the class like this:
URL url = <InsertYourClassName>.class.getResource("resources/<InsertNameOfResource>");
This will get a url path relative to where you class is and look in the resources folder for your resource. The same can be achieved by just placing the resource in the same directory as your class but not in a resources folder like this:
URL url = <InsertYourClassName>.class.getResource("<InsertNameOfResource>");
Hope this helps :)