This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Exception in expanding the tree Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Exception in expanding the tree" Watch "Exception in expanding the tree" New topic
Author

Exception in expanding the tree

Amit M Tank
Ranch Hand

Joined: Mar 28, 2004
Posts: 257
Hi,
I got this esception when I was updating the node of the JTree. I am calling the valueForPathChanged(TreePath,Object).

java.lang.ArrayIndexOutOfBoundsException: 3 >= 3
at java.util.Vector.removeElementAt(Vector.java:521)
at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.collapse(Var
iableHeightLayoutCache.java:1583)
at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.collapse(Var
iableHeightLayoutCache.java:1277)
at javax.swing.tree.VariableHeightLayoutCache.setExpandedState(VariableH
eightLayoutCache.java:170)
at javax.swing.plaf.basic.BasicTreeUI$TreeExpansionHandler.treeCollapsed
(BasicTreeUI.java:2327)
at javax.swing.JTree.fireTreeCollapsed(JTree.java:2273)
at javax.swing.JTree.setExpandedState(JTree.java:2989)
at javax.swing.JTree.collapsePath(JTree.java:1773)
at javax.swing.plaf.basic.BasicTreeUI.toggleExpandState(BasicTreeUI.java
:2106)
at javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(BasicTreeUI.jav
a:2194)
at javax.swing.plaf.basic.BasicTreeUI$MouseHandler.handleSelection(Basic
TreeUI.java:2840)
at javax.swing.plaf.basic.BasicTreeUI$MouseHandler.mousePressed(BasicTre
eUI.java:2801)
at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:21
8)
at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:21
7)
at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:21
7)
at java.awt.Component.processMouseEvent(Component.java:5131)
at java.awt.Component.processEvent(Component.java:4931)
at java.awt.Container.processEvent(Container.java:1566)
at java.awt.Component.dispatchEventImpl(Component.java:3639)
at java.awt.Container.dispatchEventImpl(Container.java:1623)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450
)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3162)

at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
at java.awt.Container.dispatchEventImpl(Container.java:1609)
at java.awt.Window.dispatchEventImpl(Window.java:1590)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)


Amit Tank
Linked In
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Are you using any custom models, etc. for the tree? The stack trace doesn't tell much about what the actual problem might be... it looks like it is trying to expand node "3" and only nodes 0-2 exist. Not sure where the extra value is coming from though...


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Exception in expanding the tree
 
Similar Threads
null pointer exception while closing a node of jtree
NullPointerException at BasicTableUI$MouseInputHandle
ConcurrentModificationException
Exception with JComboBox as Cell Editor
peculiar problem with JTree Event handling