System.exit(0) does a lot more than just closing a frame.
Type: Posts; User: Norm
System.exit(0) does a lot more than just closing a frame.
Where did you get the code from?
Why do you expect the actionPerformed method to be called?
Have you read about how to use ActionListeners?
Go to this site and read up:
How to Write an Action...
How is the method with the call to the setVisible method called? Where in your code do you call it?
You have to cause the method to be called by writing some code.
Have you tried making frame final?
final JFrame frame = ...
If there are error messages, please copy and paste the full text.
Can you explain? If there are error messages, please copy and paste the full text.
Is the frame variable in scope where you are trying to reference it?
Move its definition so it is visible where...