I added code tags to your post to make it easier to read. Please use them yourself in the future when you post source code.
Now, what exactly is the error you are getting, and what version of
Java are you using? I'm guessing it may be because you have 1.4, and this code uses features introduced in 1.5, but without those error messages, it's just a stab in the dark.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors