Oops, my bad. the "Add Contact" needs to be in quotes to denote that it's a string (the getActionCommand() method returns a String, so you must compare it to a String).
If you want to compare with...
Type: Posts; User: helloworld922
Oops, my bad. the "Add Contact" needs to be in quotes to denote that it's a string (the getActionCommand() method returns a String, so you must compare it to a String).
If you want to compare with...
Ah. The getActionCommand() for the JButton class returns the caption that you have the button under. I just put ADD because I thought that's what the button said. You'll need to change it to "Add...
mmm... long code :P
I'll tell you how you can do this, but I'll leave the implementation up to you.
Add your class to the ActionListener list of the button, and then when that ActionEvent is...