I built a GUI class, and I get the pathname of the file I want to open in this GUI class. The pathname comes back as:
public String filePath = "C\blablah";
I want to actually open my file in another class, the "Network" class, so I wrote the following code to get the path string in the Network class:
String readFile = GUI.file();
Path file = Paths.get(readFile, "Network");
I tried a few different ways but it doesn't work, I thought this one would work but it comes back with
"Cannot make a static reference to the non-static method filePath() from the type GUI"
None of those classes are my main so I cannot instantiate a GUI in the "Network" class.
Please forgive if this is a newbie question.
Edit:
This is the method I wrote in the GUI class to access the filepath in other classes
public String file(){
return filePath;
}