I have a method which is called at a event of a value change in a JComboBox
public void actionPerformed( ActionEvent e )
{
Object source = e.getSource();
if( source.equals( listComboBox ) )
{
changeList();
}
}
public void changeList()
{ //do some stuff
.....
.....
//warn the user
}
My problem is that this method is called at the initial load method as well. In the method there is a warning message pop up. Which is only needed when the user is changing the selected value of the combo box.(Not when i set a value from the code at the loading method.)
Is there a way(flag,different method) to distinguish between these to actions and give the warning message only when its needed?