As I understand the Swing architecture:
1) ActionListeners can be registered using JButton.addActionListener
2) Implicitly, the JButton has registered with the DefaultButtonModel as an Action Listener
Now when the user clicks the button
1) The DefaultButtonModel state will change, this causes an event to be queued on the EventQueue. The main thread is then relinquished
2) In the Event dispatcher thread, the JButton receives the event.
Now my question is:
Does the JButton in turn notify the listeners SYNCHRONOUSLY? or does it notify them by placing events again on the event queue?
1) ActionListeners can be registered using JButton.addActionListener
2) Implicitly, the JButton has registered with the DefaultButtonModel as an Action Listener
Now when the user clicks the button
1) The DefaultButtonModel state will change, this causes an event to be queued on the EventQueue. The main thread is then relinquished
2) In the Event dispatcher thread, the JButton receives the event.
Now my question is:
Does the JButton in turn notify the listeners SYNCHRONOUSLY? or does it notify them by placing events again on the event queue?