@icool - Instead of spoonfeeding code to the OP, how about helping him learn how to program so he can write his own code.
http://www.javaprogrammingforums.com/cafe/9544-problem-spoon-feeding.html