Wait, it's looking as if we're discussing a different problem here. The main focus of this question was on why your code was not compiling. Let's clarify this issue first. Is your code now compiling?...
Type: Posts; User: curmudgeon
Wait, it's looking as if we're discussing a different problem here. The main focus of this question was on why your code was not compiling. Let's clarify this issue first. Is your code now compiling?...
A field is a variable that is declared inside of the class, often at the top of the class, and not inside any constructor, method or other block.
Run, don't walk, to a constructor tutorial...
Either make button3 a field of the class, or declare and initialize it in the constructor *before* you try to use it.