I'm working with a combobox in a Swing-based application, and I'm having a hard time figuring out what to do to differentiate between an ItemEvent that is generated from a user event vs one caused by the application.
For instance, Lets say I have a combobox, 'combo
' and I'm listening for itemStateChanged events with my ItemListener, 'listener
'. When either a user changes the selection to item 2 or I execute the line (pseudocode):
combo.setSelection(2)
.. it seems like I'm not able to tell these events apart.
That said, I'm no Swing expert by any means, so I thought I would ask.
Thanks!