-
What does the debugging show?
-
Can you use code tags to post code? You can do that by hitting the # button above the posting area.
-
After this line:
File source = openFile(fileName);
You don't check if the file opened OK. If not (and source is not open) then the program will likely hang.