hello,
I have noticed that you did not add your button2 in your constructor and the else if statement is actually outside the actionperformed method.
try to fix that and see what you will get. ...