1. Welcome to JavaRanch.
2. Please DontWriteLongLines (←click). I've broken yours up as best I can, but before you post again, please read the UseCodeTags page thoroughly.
3. In general, we don't like people to simply post solutions (I assume that was your intent). Far better to help OP, but let him/her work it out for themselves.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here