A fourth possibility is to use a separate listener for each button or menu, but in places where code sharing is possible, have the listeners use a static method somewhere, or have the listeners call a common method in the parent object.
In my opinion,
Java is more naturally structured to have separate listeners for each button and menu item. For example, in Core Java, they try to show how different buttons can share the same listener but there is no natural mechanism to differentiate the buttons. I think they end up using the
string which is on the button, but if you ever want to internationalize your product, you will end up with different names for different buttons, so I don't like that solution.
I don't really think the code is harder to maintain with separate listeners for each button. It might be a little bigger, but that's not a real problem. What makes code hard to maintain is when you have the same code being used in three subtly different ways. Then changing that code to solve one problem can break the existing working solutions for the other cases.
Lara