I have added code tags to your post, and you can see how much better it looks. Please always use them. Also avoid tabs for indenting; use spaces instead.
What was the error? You should always tell us.
Now I have indented the code, you can see there is a statement outside a method. I think you wanted a } two lines later than you actually wrote.
If you put code outside a method (or constructor or initializer), that code can only consist of declarations. And those declarations would be declaring either instance variables or class variables, depending on whether you used the "static" modifier. Any other code (i.e. any code which isn't a declaration) has to go inside a method (or constructor or initializer).