Just the tinyest clue about your code would help reduce the number of possible causes to a finite number.
If you are using the standard file open dialog then it's just a bug in your following code. If you are entering the file path/name as a string then it's probably looking in a directory that you don't expect. You can check that out by writing a few bytes to the same file and seeing where it appears in your file system.
if (strings != stan && new File(files).exists())
What are "strings" and "stan"? Are they String? If so, you should not use "!=" to compare but equals() method instead (as strings.equals(stan)). Also, what is in "files"? Is it a file name or is it a "full path with file name"? If it is just a file name, it may be the source of the problem because Java doesn't know where to look for the file but where it is being called or at its current environment. Therefore, your file current location may be incorrect.
OK, did a user enters the full path? For example, does he/she enter "myfile.txt" or "C:\myfile.txt" or else? What you need is an absolute path, or Java will look for the file in the same folder location as the Java class. Also, you need to use file separator in order to compose the path used in calling because Windows use "\" while Unix-like use "/" file separator. One sample code that I found is here http://www.mkyong.com/java/how-to-construct-a-file-path-in-java/ and may give you an idea about how to deal with the file path.
Arrest me if im incorrect, but isnt it important that if you are using a windows system, you have to use double backslashes (or double forwardslashes) (or something like that) when specifying a whole path?).
Because you want to use it independently from the platform, you need to compose the file using the file separator. You aren't supposed to try to escape or replace the string. Look at the Properties package (java.util.Properties) for the separator. Then recompose the file full path again to use in new File.
That doesn't seem to be the problem. Instead, it seems that the problem is that when a user enters a full path, terminal tries to run it from the directory where the .jar file is. What I need is a way to specify the working directory to the root of the computer (Meaning "C:\" in Windows, and "/" in *nix).