:( Text File Opening Problem
I am just got trapped in a very bad situation,
Trying to open a text file and shows the text into a jTextPane... But problem is that when i am trying to open that file with a File object it gives an error of path not found,
I had tried two ways to open it :
here the dicrectory "FileFolder" is different from the folder in which the Class is created (whose name is "Classes"), but both the folders are in same Source folder "src" in my NetBeans Project Folder.
File f = new File("/FileFolder/file.txt");
It shows me error that Specified path is not found
The second way i am trying is :
I have tried this way by copy the file.txt into that same folder in which my class is exist that is, Classes folder..
File f = new File(getClass().getResource("file.txt").getFile());
But her also a strange error occurs and message shows that :
The system cannot find the path specified.
Actualy it tries to open the path :
I know this is wrong, but i am unable to understand that WHY IT OPENS THE "CLASSES" FOLDER TWO TIMES???? :frusty: Actually that correct path must be like:
Please help me out from this........:(-: