Your code needs to test that both Scanner objects has a next line. You are only testing one.
You are assuming that the first file does not have more lines than the second file.