I have two classes. One class works does the calculations, whilst the other is a GUI to present them.
My problem is - I have "hard coded" a file path into my calculations class and can't seem to find a way to make it dynamic. As the code is fairly long, I uploaded it. Please tell me if you'd prefer me to paste it here.
GUI Class: http://pastebin.com/qNU7jVV0
Calculations Class: http://pastebin.com/rSGr9KL7
A solution in simple terms would be very helpful. Thanks.
in Calculations Class:
public File setFile(String filepath){
try{
jpegFile = new File(filepath);
}
catch (IOException e) {
e.PrintStackTrace();
}
return jpegFile;
}
now in GUI, to set the file to the given file path, just call metaData.setFile("C:\\mypic.jpg");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.