when I run, all messages and println command shown in red and processing ide stop working

edited February 2018 in Using Processing

error text :

Exception in thread "AWT-EventQueue-0" java.util.EmptyStackException
    at java.util.Stack.peek(Stack.java:102)
    at javax.swing.text.DefaultStyledDocument$ElementBuffer.insertElement(DefaultStyledDocument.java:1827)
    at javax.swing.text.DefaultStyledDocument$ElementBuffer.insertUpdate(DefaultStyledDocument.java:1566)
    at javax.swing.text.DefaultStyledDocument$ElementBuffer.insert(DefaultStyledDocument.java:1436)
    at javax.swing.text.DefaultStyledDocument.insert(DefaultStyledDocument.java:212)
    at processing.app.ui.BufferedStyledDocument.insertAll(EditorConsole.java:400)
    at processing.app.ui.EditorConsole.flush(EditorConsole.java:94)
    at processing.app.ui.EditorConsole$1.actionPerformed(EditorConsole.java:112)
    at javax.swing.Timer.fireActionPerformed(Timer.java:313)
    at javax.swing.Timer$DoPostEvent.run(Timer.java:245)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Exception in thread "AWT-EventQueue-0" java.util.EmptyStackException
    at java.util.Stack.peek(Stack.java:102)
    at javax.swing.text.DefaultStyledDocument$ElementBuffer.insertElement(DefaultStyledDocument.java:1827)
    at javax.swing.text.DefaultStyledDocument$ElementBuffer.insertUpdate(DefaultStyledDocument.java:1566)
    at javax.swing.text.DefaultStyledDocument$ElementBuffer.insert(DefaultStyledDocument.java:1436)
    at javax.swing.text.DefaultStyledDocument.insert(DefaultStyledDocument.java:212)
    at processing.app.ui.BufferedStyledDocument.insertAll(EditorConsole.java:400)
    at processing.app.ui.EditorConsole.flush(EditorConsole.java:94)
    at processing.app.ui.EditorConsole.stopTimer(EditorConsole.java:122)
    at processing.app.ui.EditorConsole.setEditor(EditorConsole.java:212)
    at processing.app.Base.handleActivated(Base.java:555)
    at processing.app.ui.Editor$2.windowActivated(Editor.java:187)
    at java.awt.AWTEventMulticaster.windowActivated(AWTEventMulticaster.java:390)
    at java.awt.AWTEventMulticaster.windowActivated(AWTEventMulticaster.java:389)
    at java.awt.Window.processWindowEvent(Window.java:2066)
    at javax.swing.JFrame.processWindowEvent(JFrame.java:305)
    at java.awt.Window.processEvent(Window.java:2013)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:995)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:488)
    at java.awt.Component.dispatchEventImpl(Component.java:4760)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.SentEvent.dispatch(SentEvent.java:70)
    at java.awt.DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent.dispatch(DefaultKeyboardFocusManager.java:217)
    at java.awt.DefaultKeyboardFocusManager.sendMessage(DefaultKeyboardFocusManager.java:244)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:366)
    at java.awt.Component.dispatchEventImpl(Component.java:4760)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.SequencedEvent.dispatch(SequencedEvent.java:128)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Exception in thread "AWT-EventQueue-0" java.util.EmptyStackException
    at java.util.Stack.peek(Stack.java:102)
    at javax.swing.text.DefaultStyledDocument$ElementBuffer.insertElement(DefaultStyledDocument.java:1827)
    at javax.swing.text.DefaultStyledDocument$ElementBuffer.insertUpdate(DefaultStyledDocument.java:1566)
    at javax.swing.text.DefaultStyledDocument$ElementBuffer.insert(DefaultStyledDocument.java:1436)
    at javax.swing.text.DefaultStyledDocument.insert(DefaultStyledDocument.java:212)
    at processing.app.ui.BufferedStyledDocument.insertAll(EditorConsole.java:400)
    at processing.app.ui.EditorConsole.flush(EditorConsole.java:94)
    at processing.app.ui.EditorConsole.stopTimer(EditorConsole.java:122)
    at processing.app.ui.EditorConsole.setEditor(EditorConsole.java:212)
    at processing.app.Base.handleActivated(Base.java:555)
    at processing.app.ui.Editor$2.windowActivated(Editor.java:187)
    at java.awt.AWTEventMulticaster.windowActivated(AWTEventMulticaster.java:390)
    at java.awt.AWTEventMulticaster.windowActivated(AWTEventMulticaster.java:389)
    at java.awt.AWTEventMulticaster.windowActivated(AWTEventMulticaster.java:389)
    at java.awt.Window.processWindowEvent(Window.java:2066)
    at javax.swing.JFrame.processWindowEvent(JFrame.java:305)
    at java.awt.Window.processEvent(Window.java:2013)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:995)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:488)
    at java.awt.Component.dispatchEventImpl(Component.java:4760)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.SentEvent.dispatch(SentEvent.java:70)
    at java.awt.DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent.dispatch(DefaultKeyboardFocusManager.java:217)
    at java.awt.DefaultKeyboardFocusManager.sendMessage(DefaultKeyboardFocusManager.java:244)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:366)
    at java.awt.Component.dispatchEventImpl(Component.java:4760)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.SequencedEvent.dispatch(SequencedEvent.java:128)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Exception in thread "AWT-EventQueue-0" java.util.EmptyStackException
    at java.util.Stack.peek(Stack.java:102)
    at javax.swing.text.DefaultStyledDocument$ElementBuffer.insertElement(DefaultStyledDocument.java:1827)
    at javax.swing.text.DefaultStyledDocument$ElementBuffer.insertUpdate(DefaultStyledDocument.java:1566)
    at javax.swing.text.DefaultStyledDocument$ElementBuffer.insert(DefaultStyledDocument.java:1436)
    at javax.swing.text.DefaultStyledDocument.insert(DefaultStyledDocument.java:212)
    at processing.app.ui.BufferedStyledDocument.insertAll(EditorConsole.java:400)
    at processing.app.ui.EditorConsole.flush(EditorConsole.java:94)
    at processing.app.ui.EditorConsole.stopTimer(EditorConsole.java:122)
    at processing.app.ui.EditorConsole.setEditor(EditorConsole.java:212)
    at processing.app.Base.handleActivated(Base.java:555)
    at processing.app.ui.Editor$2.windowActivated(Editor.java:187)
    at java.awt.AWTEventMulticaster.windowActivated(AWTEventMulticaster.java:390)
    at java.awt.AWTEventMulticaster.windowActivated(AWTEventMulticaster.java:389)
    at java.awt.AWTEventMulticaster.windowActivated(AWTEventMulticaster.java:389)
    at java.awt.Window.processWindowEvent(Window.java:2066)
    at javax.swing.JFrame.processWindowEvent(JFrame.java:305)
    at java.awt.Window.processEvent(Window.java:2013)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)

I see this thing when I run sketch.

image

because of this, I cannot find my code's problem. I am thinking that part of my code is making processing stop...

my sketch's code is here.
processing sketch
ui code

If you know this, help me...

Answers

  • far too much code to look at. where do we start.

    anyway, this is a clue

    java.util.EmptyStackException at java.util.Stack.peek(Stack.java:102)

    you are trying to peek an empty stack. are you using the stack class directly?

  • edited February 2018

    No, I did not used stack class. This error is actually came out from processing ide.(stack trace says processing.app.ui package) but it occurs only in that sketch.

    I was editing part of TabLayout's listeners in bottomof ev2.pde and kyui.element.TabLayout class, and there was some IndexOutOfBounds Exception in TabLayout class removeTab method and I was fixing it.

    It occurs when I make IndexOutOfException or sometimes I just run, and that comes out.

Sign In or Register to comment.