About Defining a Method for Java Buttons
To define a method, you must declare a Java method as public static void, taking zero or more String parameters in the .class file.