/* Reads a file of words. Can be used to add file words into a binary tree. */ import javax.swing.JOptionPane; import java.util.Scanner; import java.io.*; public class ReadFile { final static int MAXWORDS = 1000; final static int MAXLENGTH = 81; public static void main(String[] args) { String word; String[] wordArray = new String[MAXWORDS]; FileReader infile = null; try { infile = new FileReader("wordfile1.txt"); } catch (FileNotFoundException ex) { System.out.println("File does not exist"); } Scanner scanner = new Scanner(infile); int i=0; while (scanner.hasNext()) { word = scanner.next(); // System.out.print(word + " "); wordArray[i] = word; // System.out.print(wordArray[i]); i++; } // System.out.println(); for(int j=0; j