Campbell Ritchie wrote:And why are you using addActionListener(this) in the first place? I know you find it in lots of books, and even the Java Tutorials, but it usually means you are departing from object‑oriented design.
That isn't necessarily what is happening. The user clicks on a button, and it switches from nothing to either an O or X. The OP also wants to disable the action so it can't be switched again. Since when you switch the button's display you are currently 'in' the action listener which does the switching when you want to disable the switching removeActionListener(this) should remove that ability regardless of how your listeners are defined.