Original Post
I have this problem: I am using an engine where a 3d model is being read from a resource path. In order to do that I have to set a classpath to the directory the model resides e.g. C:\file\model, and then add the following string to the reader /obj/box.obj. Of course it works. But, what I want is for the user to select any obj file and be capable of loading. I dont want this to be fixed. I have used JFileChooser where a new window pops up and the user select the file which in turn is stored in "File file = chooser.getSelectedFile();". Since the reader of the engine needs a string I use the method "file.getName();" to take the string name of the file. I also use the method "file.getPath();" to take the string of the path where the file resides. So now what I want is: a way everytime the user selects a file for the path to be added to my classpath thus allowing the reader to read the file. Is there a way to add a classpath in the program itself and not in the IDE properties?