On quick glance at your code, I see that you have methods with parameters that are never used.
For instance if you declare a method like so:
|
Code:
|
public void load(String pirateTxt) throws IOException { |
Then you don't want to hard-code the file name within the method like so:
|
Code:
|
Scanner infile = new Scanner(new InputStreamReader(new FileInputStream("pirate.txt"))); |
If you do this, why even bother giving the method a parameter. Instead, use the parameter:
|
Code:
|
Scanner infile = new Scanner(new InputStreamReader(new FileInputStream(pirateTxt))); |
Otherwise if you still have problems, you should do some debugging to find out more.