It looks like you have mis-matching brackets in your onCommand
method.
The bracket at the end of your code finishes one of the if statements, but you do not have a bracket that finishes the method, or one that finishes the class.
If you add another two brackets at the end of your code, this problem should disappear. I'd encourage you to use your IDE or editor to help you to check that the brackets match correctly.