Look at the Java Sun tutorial on ActionEvents and ActionListener. They have all the examples you need as well. I was able to learn all about them by myself, and so will you, if you read. If you have any specific questions, ask those...
I am pretty sure the thread starter has already found a solution, sumit_hotchap is the culprit for resurrecting this thread of more than two years go.
<EDIT>
And just for the record, the first solution is the best solution, the thread starter just doesn't know what the heck she is talking about in the second post