AWT-EventQueue Block

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

AWT-EventQueue Block

robbiezl
I write a program to show the Swing buffer in JOGL,when i typed the Swing buffer in JOGL,the real Swing changed.
But the AWT-EventQueue Blocked,i do not know why,I use jvisualvm.exe to see the thread dump.

"AWT-EventQueue-0" prio=6 tid=0x04e30800 nid=0xcf0 waiting for monitor entry [0x068bf000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at java.awt.Component.invalidate(Component.java:2763)
        - waiting to lock <0x25721938> (a java.awt.Component$AWTTreeLock)
        at java.awt.Container.invalidate(Container.java:1446)
        at javax.swing.JComponent.revalidate(JComponent.java:4789)
        at javax.swing.plaf.basic.BasicTextUI$RootView.preferenceChanged(BasicTextUI.java:1394)
        at javax.swing.text.View.preferenceChanged(View.java:272)
        at javax.swing.text.PlainView.updateDamage(PlainView.java:540)
        at javax.swing.text.PlainView.insertUpdate(PlainView.java:425)
        at javax.swing.text.FieldView.insertUpdate(FieldView.java:276)
        at javax.swing.plaf.basic.BasicTextUI$RootView.insertUpdate(BasicTextUI.java:1590)
        at javax.swing.plaf.basic.BasicTextUI$UpdateHandler.insertUpdate(BasicTextUI.java:1849)
        at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:185)
        at javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:734)
        at javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:693)
        at javax.swing.text.PlainDocument.insertString(PlainDocument.java:114)
        at javax.swing.text.AbstractDocument.replace(AbstractDocument.java:655)
        at javax.swing.text.JTextComponent.replaceSelection(JTextComponent.java:1351)
        at javax.swing.text.DefaultEditorKit$DefaultKeyTypedAction.actionPerformed(DefaultEditorKit.java:859)
        at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1633)
        at tools.FlatAWTEventProcessTool.processKeyBinding(FlatAWTEventProcessTool.java:120)
        at tools.FlatAWTEventProcessTool.processKeyTypeEvent(FlatAWTEventProcessTool.java:70)
        at graphic.shape.RelationFlat.keyTyped(RelationFlat.java:545)
        at app.mode.NormalMode.keyTyped(NormalMode.java:278)
        at app.manager.JOGLBrowserModeManager.keyTyped(JOGLBrowserModeManager.java:82)
        at app.manager.JOGLBrowserManager.keyTyped(JOGLBrowserManager.java:81)
        at java.awt.Component.processKeyEvent(Component.java:6222)
        at java.awt.Component.processEvent(Component.java:6044)
        at java.awt.Component.dispatchEventImpl(Component.java:4630)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
        at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
        at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
        at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
        at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
        at java.awt.Component.dispatchEventImpl(Component.java:4502)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

how can i fix this problem.thanx.
sorry for my poor English.
Reply | Threaded
Open this post in threaded view
|

Re: AWT-EventQueue Block

gouessej
Administrator
Hi

What do you mean by "Swing buffer"?

What are you trying to do?

Edit.: Maybe you should not update any component directly in your listener(s), I would rather push changes on the event queue with SwingUtilities.invokeLater(Runnable runnable) or with a similar mechanism if this operation contains OpenGL code.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: AWT-EventQueue Block

robbiezl
thanx,gouessej,with SwingUtilities.invokeLater(Runnable runnable)  i fixed it.
Reply | Threaded
Open this post in threaded view
|

Re: AWT-EventQueue Block

gouessej
Administrator
You're welcome but please, in the future, provide a small test case if you want to get some precise help.
Julien Gouesse | Personal blog | Website