Hi, loaded charts are added to the Window menu, –
layout.add( new SeparatingMenuPiece( new SingleCDockableListMenuPiece( dk.control ), true, false, true )).
“layout” is a new RootMenuPiece.
The below exception appears when a dockable chart is deleted and a new chart is loaded when more than two charts are added. Printed the indexes in RootMenuPiece.java:103 - remove(…), but its called more than I expected.
This is how the chart is deleted, control.removeSingleDockable(dockable.getUniqueId()).
It doesn’t consistently generate an exception, I can’t find a pattern.
Exception in thread “VisualATS_DF1.1” java.lang.IllegalArgumentException: index greater than the number of items.
at javax.swing.JPopupMenu.remove(JPopupMenu.java:472)
at javax.swing.JMenu.remove(JMenu.java:831)
at bibliothek.gui.dock.facile.menu.RootMenuPiece$2.remove(RootMenuPiece.java:103)
at bibliothek.gui.dock.support.menu.MenuPiece.fireRemove(MenuPiece.java:86)
at bibliothek.gui.dock.facile.menu.NodeMenuPiece.access$300(NodeMenuPiece.java:40)
at bibliothek.gui.dock.facile.menu.NodeMenuPiece$Listener.remove(NodeMenuPiece.java:184)
at bibliothek.gui.dock.support.menu.MenuPiece.fireRemove(MenuPiece.java:86)
at bibliothek.gui.dock.support.menu.SeparatingMenuPiece$Listener.remove(SeparatingMenuPiece.java:345)
at bibliothek.gui.dock.support.menu.MenuPiece.fireRemove(MenuPiece.java:86)
at bibliothek.gui.dock.support.menu.BaseMenuPiece.removeAll(BaseMenuPiece.java:122)
at bibliothek.gui.dock.facile.menu.CloseableDockableMenuPiece.order(CloseableDockableMenuPiece.java:135)
at bibliothek.gui.dock.facile.menu.CloseableDockableMenuPiece.access$100(CloseableDockableMenuPiece.java:54)
at bibliothek.gui.dock.facile.menu.CloseableDockableMenuPiece$2.run(CloseableDockableMenuPiece.java:117)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)