Including Data files in Jars

In the hangman program you need to use a Dctionary file: You simply include the file when creating the jar.

The code for creating the input stream to read from must be changed to soething like the following:

InputStream f = (hangmanGUI3.class.getResourceAsStream("dict"));
Scanner sc = new Scanner(f);
Sebastian Danicic BSc MSc PhD (Reader in Computer Science)
Dept of Computing, Goldsmiths, University of London, London SE14 6NW
Last updated 2015-09-04