You did already by implementing the action listener. Google the term anonymous class and you will see many explanations. My recommendation above might be better illustrated with the following:
...
Type: Posts; User: copeg
You did already by implementing the action listener. Google the term anonymous class and you will see many explanations. My recommendation above might be better illustrated with the following:
...
Add some println's in there to see the values of the variables...in particular, the listener object when you try to add the listener will be null. You must first instantiate it (create the anonymous...
You need a semicolon at the end of the anonymous class definition (my code above did not reflect this - edited)
The code you posted does not appear to implement a listener. It defines a listener, but never implements the actionPerformed method, which is required. Recommend you read through the following links:...