How can I check if an event is user generated? When the user clicks on a combo box and changes the displayed/selected content, I want the code in the itemStateChanged method to be executed. But I only want this code to be executed if the method call was due to a user generated event, not a programmatically generated one. How can I differentiate?

itemStateChanged(ItemEvent e){
if (user_generated){
//do stuff here
}
}

actually it'd be actionPerformed in this case, but the question remains the same

Nevermind. All of them should be user generated, that's the whole point. I got confused because I thought something was happening that was not happening. Or something. Either way it's been working for a while now.