public final class EventDispatchThreadHangMonitor extends EventQueue
The principle is to record the time at which we start processing an event, and have another thread check frequently to see if we're still processing. If the other thread notices that we've been processing a single event for too long, it prints a stack trace showing what the event dispatch thread is doing, and continues to time it until it finally finishes.
This is useful in determining what code is causing your Java application's GUI to be unresponsive.
| Modifier and Type | Method and Description |
|---|---|
protected void |
dispatchEvent(AWTEvent event)
Overrides EventQueue.dispatchEvent to call our pre and post hooks either side of the system's event dispatch
code.
|
static void |
initMonitoring()
Sets up hang detection for the event dispatch thread.
|
createSecondaryLoop, getCurrentEvent, getMostRecentEventTime, getNextEvent, invokeAndWait, invokeLater, isDispatchThread, peekEvent, peekEvent, pop, postEvent, pushpublic static void initMonitoring()
protected void dispatchEvent(AWTEvent event)
dispatchEvent in class EventQueueevent - DOCUMENT ME!Copyright © 2012–2026 cismet GmbH. All rights reserved.