Edit: Just noticed the topic is a duplicate of this one. Please don't post duplicate topics.

I've showed you how to use the same ActionListener for multiple buttons in the code below, but there...