Error with selectInput

Hello everone,

I've made a code with selectInput, so that the user can select an image. Sometimes it works, but sometimes I get the following error:

java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at processing.core.PApplet.selectCallback(PApplet.java:6443)

at processing.core.PApplet.access$0(PApplet.java:6436)

at processing.core.PApplet$3.run(PApplet.java:6348)

at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)

at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)

at java.awt.EventQueue.access$500(EventQueue.java:97)

at java.awt.EventQueue$3.run(EventQueue.java:709)

at java.awt.EventQueue$3.run(EventQueue.java:703)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)

at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)

at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)

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

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

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

Caused by: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 1

at processing.data.StringList.get(StringList.java:138)

at Login.fileSelected(Login.java:337)

In my code, the selectInput is replacing an specific indexnumber of an String array. Does anybody knows what this error means?

Regards, Daantje

By the way: the programm doesn't crash or gives an nullpointer exeption. The programm does still run, but it only gives me this message...

Tagged:

Answers

  • Answer ✓

    The problem might be in your code, could you post it?

  • Sorry, I've found the problem. I cleared the StringList and after that, I tried to get data out of it ;|

    Thanks for your answer

Sign In or Register to comment.