Add some println's in there (or use a debugger) and step through the code. See http://www.javaprogrammingforums.com/blogs/copeg/5-debugging-system-out-println.html