Java Swing Tutorials - Herong's Tutorial Examples - v4.31, by Herong Yang
"AWT blocker activation interrupted" Error in JDK 1.6
This section provides a tutorial example on the condition for the 'AWT blocker activation interrupted' error in JDK 1.6.0.
When I ran the same test program, FrameThreads.java, listed in the previous tutorial with JDK 1.6 or JDK 1.7, I got some interesting results.
Test 1 - Run FrameThreads.java in a command window and wait:
herong> \progra~1\java\jdk1.6.0_02\bin\java FrameThreads Active thread = main Active thread = AWT-Shutdown Active thread = AWT-Windows Active thread = AWT-EventQueue-0 Interrupting thread = AWT-Shutdown Interrupting thread = AWT-Windows Interrupting thread = AWT-EventQueue-0
All three AWT threads are terminated. But 3 frame windows are still displayed on the screen forever. That means the run-time exception issue is fixed now.
Noticed that the "Java2D Disposer" thread is not there anymore in JDK 1.6.0. But if you check the parent thread group, the "system" thread group, you will see the "Java2D Disposer" thread. In other words, the "Java2D Disposer" thread is moved from the "main" thread group to its parent, the "system" thread group.
Test 2 - Run FrameThreads.java in a command window and run Internet Explorer in full screen to hide those 3 frame windows. About 3 minutes later, all 3 frame windows are terminated. The console window shows:
herong> \progra~1\java\jdk1.6.0_02\bin\java FrameThreads Active thread = main Active thread = AWT-Shutdown Active thread = AWT-Windows Active thread = AWT-EventQueue-0 Interrupting thread = AWT-Shutdown Interrupting thread = AWT-Windows Interrupting thread = AWT-EventQueue-0 AWT blocker activation interrupted: java.lang.InterruptedException at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:485) at sun.awt.AWTAutoShutdown.activateBlockerThread(AWTAutoShutdow... at sun.awt.AWTAutoShutdown.setToolkitBusy(AWTAutoShutdown.java:... at sun.awt.AWTAutoShutdown.notifyToolkitThreadBusy(AWTAutoShutd... at sun.awt.windows.WToolkit.eventLoop(Native Method) at sun.awt.windows.WToolkit.run(WToolkit.java:290) at java.lang.Thread.run(Thread.java:619)
This tells me that the AWT package in JDK 1.6 is still having some issues if its threads are interrupted. So do not interrupt AWT threads.
Table of Contents
Introduction of Java Swing Package
Graphics Environment of the Local System
Creating Frames with Sizes and Locations
Closing Frame and Terminating Application
Listing and Interrupting AWT Threads
►"AWT blocker activation interrupted" Error in JDK 1.6
JFrame Thread Behavior with JDK 8 to 12
Displaying Chinese Characters in Frame Title
Drawing Graphics - Using paint() on Frame
Drawing Graphics - Using paint() on Component
Drawing Graphics - Using paint() on Content Pane
Drawing Chinese Characters on Frames
JCheckBox - Swing Check Box Class
JRadioButton - Swing Radio Button Class
JTextField - Swing Text Field Class
JComboBox - Swing Combo Box Class
Menu Bar, Menus, Menu Items and Listeners
Creating Internal Frames inside the Main Frame
Layout of Components in a Container
JEditorPane - The Editor Pane Class
SwingWorker - The Background Task Worker
AWT (Abstract Windows Toolkit)