Netbeans, relative path and user.dir problems.
807597Oct 12 2004 — edited Mar 12 2007Honestly, I must be going blind. I have been searching high-and-low to solve this stupid problem.
I have a mounted fileSystem in Netbeans 3.6. There is a number of folders, with subfolers, e.g., com.username.program.frontend......etc., etc....
Part of the code pulls in image files from a different folder sitting beside the folder in which the class requiring this image belongs. In other words, I have a folder called Program, inside this folder are two subfolders Code and Pictures. In code is a class which requires an image from the folder Pictures.
Using the relative path as:
= new ImageIcon("Pictures\\icon.jpg");
It will not load this file. So I decided to try outputting what netbeans thinks is the user directory , by using:
System.out.println(System.getProperty("user.dir"));
I get the output.............. "C:\Program Files\Netbeans 3.6\"
So I am assuming that the relative paths attaches itself to "C:\Program Files\Netbeans 3.6\", which would not exist. I have looked throughout all of Netbeans, changed nearly bloomin everything, and I still can't seem to get this working. I have used the Eclipse IDE, and it uses the mounted directory as the user directory, hence relativepath would work. Netbeans on the other hand, isn't doing this!!!!
Help!!
Thanks :-)