Hardcode a file location into code, removing user input
This should be a really easy question, but I just cant seem to get it done, I have a section of code calculating X Y points on a graph, then saving them to file.
If a certain condition is met I want to plot the values on a graph, I am using this code to plot the graph- How do I draw / plot a graph?
But I don't want it to ask for the user to point to the file location, I just want it to open a file which has a directory hard coded in, and plot it automatically. So basically remove the buttons at the top and carry out the commands of the buttons automatically.
Would be fantastic if somebody could point me in the right direction, I'm a physicist not a coding expert so as much help as possible would be excellent.
Hope I can help one of you in return sometime,
Re: Hardcode a file location into code, removing user input
There are several I/O classes that have constructors that take a path to file.
Read the contents of the file with the path into a String and use that String in the class's constructor to read from the other file.