Welcome to JavaRanch
Have you been told to use StringTokenizer? It is described
here as legacy code and users are "discouraged" from using it in new code.
You can get individual lines from a text file by various techniques; I think the
Scanner#nextLine() method might be the simplest. Then you can use the
java.lang.String#split method to separate it into words.
You can do all sorts of things with those words, even putting them into a
java.util.Set<
String> which has a contains method.