I would like to use Java, if possible, to analyze the text a user is typing and count down how many words from a specified number of words are left for the user to type.