problems with event handlers
I have a GUI project, but the instructions I'm given on what is supposed to happen in each event handler is uncleared.
For one of them, it is supposed to delete a file made in another event handler. However, I do not know how to delete the file. Can someone help me with this?
For a different event handler, it is supposed to check to make sure all fields are filled in, but I do not know how to write the code to check this. I'm also supposed to store 4 pieces of data to a file on a separate line. However, i don't know how to do this. I have another method, but I don't think I can put a method into a event handler. Can someone help me with this too?
Re: problems with event handlers
See the File class. It has a method to delete a file.
how to delete the file
If they are textfields, get the text that they hold and check for valid contents. The String class has methods to check if there is any data in the String that you get from the text fields.
make sure all fields are filled in,
Look at the PrintWriter class for an easy way to write lines with data to a file.
store 4 pieces of data to a file on a separate line