We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › controlp5 scroll list error
Page Index Toggle Pages: 1
controlp5 scroll list error (Read 320 times)
controlp5 scroll list error
Dec 19th, 2008, 9:56pm
 
I am currently creating a GUI to control a series of animations. I have an empty scroll list to which a new item is added every time an animation runs (basically contains a list of all active animations at any given time). When an animation stops running, a listener is activated and it should be removed from the list. The problem I am running into is an error when I remove an item when only one exists in the scroll list:

Code:

Exception in thread "Thread-9" java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 1
at java.util.Vector.get(Unknown Source)
at controlP5.ControllerList.get(Unknown Source)
at controlP5.ScrollList.removeItem(Unknown Source)
at net.electroland.lafm.gui.GUI.removeActiveShow(GUI.java:70)
at net.electroland.lafm.core.Conductor.notifyComplete(Conductor.java:202)
at net.electroland.lafm.core.ShowThread.run(ShowThread.java:129)


Any ideas?
Re: controlp5 scroll list error
Reply #1 - Dec 19th, 2008, 10:56pm
 
A quick follow up:
I added a placeholder item as the first thing, then dynamically added and removed an item and got another arrayindexoutofbounds exception with a value of 2 this time.

Could this potentially be a threading conflict?
Page Index Toggle Pages: 1