Probably because you haven't described the problem. You didn't say what constituted "works fine" and "doesn't". You didn't post any error messages or say whether any errors occurred. The problem could even be that one version of the code didn't compile for all we can tell. You need to provide details.
We still don't know what "the problem" is. Have you checked the Java Console for error messages? What are you expecting to happen, and what is actually happening? TellTheDetails
Don't get me started about those stupid light bulbs.