Looking at that code, I would assume that the four objects, tryAgain, one, two, and three, all share the same action listener, and this method is the actionPerformed(
ActionEvent) method within that class. When an event is triggered, this method is called.
Then, you check four things. First, you check if the object that triggered the event (
event.getSource()) is the same object as tryAgain. You perform the same check three more times with different objects.
Note that == compares memory. The code works because when objects are passed into methods the value is not passed in, but a reference of the memory location.
Greetings.
Marcus