This assignment is to write a Java program to:
prompt the user for a text file name
read words (a word is a sequence of letters) from the file and count the number of times each word appears.
display the words along with the corresponding number of times the words appear:
in word alphabetic order and
in the number of times each word appears order
Requirements:
Design a separate public class Word satisfying:
The class must have 2 private fields (String for a word and int for it's count)
The class must override the class Object's equals, hashCode and toString methods
The class must implement the Comparable interface using the String field's compareTo method.
use a JOptionPane to prompt the user for the file name
store the words and counts in an ArrayList<Word> object.
use the Collections class sort method to sort the ArrayList<Word>
display the results on a JTextArea in a JScrollPane in a JOptionPane
align the words and counts to start in the same column
use the Collections class sort method to sort the ArrayList<Word> in word count order (a Comparator<Word> object will be needed for this)
display the results on a JTextArea in a JScrollPane in a JOptionPane
This assignment is due on Thursday June 1st at the beginning of class. At that time there will be a 10 minute quiz on the assignment. Hand in a printout of the source file and a printout of the javadoc output (the Word html file).