I'm having trouble figuring out how to implement my "throws IOException". Whenever I am closing my filechannels and filestreams, its telling me IOException must be caught or declared to be thrown.
I can't get that far still... I'm getting FileNotFoundException on my input streams.. not sure what I'm overlooking, I've been going through a few different programs trying to figure it out, just can't get it going when the file names are coming from the textboxes
on the throws IOException, i had that problem too, and because i am implementing ActionListener i can not add throws to the method. So to get around this i put all the close methods in another try-catch. so I have something like finally{ try{ the close stuff } catch IOException(object) { a message} }
On the FileNotFoundException, does it work if say you put the infile.txt in c:\ dir (aka drive root dir) and type in c:\infile.txt. I had some problems with file not found, because of the way eclipse handles the path of the compiled program. If you use eclipse and don't want to put a full path to the files, you have to put it in the project directory and not the bin or src directory.
I tried putting a direct path into the program "c:\infile.txt" moved a copy of the infile there but it still errors, it keeps erroring saying it can't find the file. I've tried a few different ways and get one error or another that it can't find something... going through different code examples online trying to find my problem or figure out another apporoch..
Got this project 4 to run, finally. I didn't put the finally clause in it, just the try and catch. Pretty much after I got my GUI up, I added some button listeners and added project 2 codes to it. Changed the args to a varible that reads what the user input. Had the same problem as Chad with the finally causing errors but once I got rid of it, the code worked fine. Don't know if the finally is important. It might come back and bite me later down the road for not understanding how to use.
finally got it going also, had to leave out the finally statements also. figure worse case lose a couple points for that, at this point I'm just happy it runs lol