Once again another terrible question.
Once again the problem is your code and we can't help without a
SSCCE.
Run the demos from the Swing tutorial for working examples. I'm sure you have been given a link to the tutorial in past questions. If not then read the JButton API and you will find a link.