gpt4 book ai didi

java - 无法解释 java 堆栈跟踪

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:03:32 25 4
gpt4 key购买 nike

<分区>

我有一个堆栈跟踪,我需要一些帮助来解释:

java.lang.ArrayIndexOutOfBoundsException: 36 >= 36
at java.util.Vector.elementAt(Vector.java:427)
at javax.swing.tree.VariableHeightLayoutCache.getNode(VariableHeightLayoutCache.java:976)
at javax.swing.tree.VariableHeightLayoutCache.getPreferredHeight(VariableHeightLayoutCache.java:274)
at javax.swing.plaf.basic.BasicTreeUI.updateCachedPreferredSize(BasicTreeUI.java:1823)
at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:1924)
at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:1912)
at javax.swing.JComponent.getPreferredSize(JComponent.java:1642)
at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:769)
at java.awt.Container.layout(Container.java:1420)
at java.awt.Container.doLayout(Container.java:1409)
at java.awt.Container.validateTree(Container.java:1506)
at java.awt.Container.validate(Container.java:1479)
at javax.swing.RepaintManager$2.run(RepaintManager.java:698)
at javax.swing.RepaintManager$2.run(RepaintManager.java:696)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:695)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1679)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

堆栈中的所有文件或函数都不适合我的程序,因此根据我的估计,它必须 100% 是 swing 内部的。但这并不是说这可能不是我的程序有问题。

我几乎可以了解当时 JVM 在做什么的要点 - 看起来它正在重新绘制滚动 Pane 中的我的一个 JTree 组件(我有几个,所以我不知道它是哪个可能是)。

对于可能导致此错误的原因,我最好的猜测是树的内容(以及其中的节点数)在重绘期间的某个时刻发生了变化,因此存储子节点的 vector 的大小发生了变化,同时正在研究它以获得组件尺寸。

这听起来合理吗?

如果是这样,我该如何绕过它?我想我想在进行任何更新时阻止重新绘制,或者相反地在进行任何重新绘制时阻止更新?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com