• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exception in expanding the tree

 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
reply
    Bookmark Topic Watch Topic
  • New Topic