Recording everything that passes through the stream of events seems like a cumbersome way to diagnose freezing. Wouldn't it be easier to wait until a problem arises, and then ask βEvent Manager,β what is he doing now? One way to do this is to enable JMX monitoring , connect to your running process using a JMX client such as VisualVM (which comes with the JDK), wait for the problem to appear, and then take a stream dump .
If you still want to register everything that happens in the Event Dispatch Thread, you can do this:
- In Eclipse, run the application in debug mode.
Create a breakpoint on EventQueue.dispatchEvent , right-click it, select "properties", check "condition" and enter the following "condition":
System.out.println(arg0); return false;
source share