Counting words java applet

Can anyone please help me! Very stuck on an assignment i need to code a java applet so that it counts the lengths of words for example i am a man would produce the output 2 - one letter words 1 - two letter word and 1 - three letter word.

Thank you for your help, i have read numerous textbooks about the string class i just can't seem to get my head round this! Is there anything else you can suggest to do? Also i am not allowed to use the swing library. Thank again