When a mousePressed event is received on a button the following code is executed:
if (!model.isArmed())
{
model.setArmed(true);
}
model.setPressed(true);
Every time the state of the model is changed a ChangeEvent is generated to you get two events.
Same on a mouseReleased:
model.setPressed(false);
model.setArmed(false);
So each MouseEvent will generate multiple ChangeEvents.
Are the methods, addActionListener and addChangeListener part of JButton
Read the API documentation. It will tell you in which class the methods are defined.
The output should be
The order of output is not dependent on the order in which you add the listeners to the component. The ActionEvent will not be generated until the mouse have been pressed and released or the spacebar has been pressed and released.