My sample Java code.  Check out www.CSLearner.com