A) I would recommend that you temporarily remove the listener from a software choice.
B) If your software changes do not affect another GUI event, you can solve it as follows in an ugly / unreliable / error-prone / βcrackedβ way. Check EventQueue.isEventDispatchThread() to see if a click has been clicked on a GUI thread (user).
C) (I just re-read your question and saw that you already found the method described below. Basically, I would say that this (or the method described above) is your best alternative.)
Another option is to have a boolean flag called nonUserSelection that you set to true before you select the value programmatically, and reset is false. In the action listener you just add
if (nonUserSelection) return;
source share