edited March 2018 in Library Questions

Hi All--

I'm trying to troubleshoot an error I'm getting that's freezing my code. I've made a gui using controlP5 and underlying code to process text files and send characters over serial. I don't have much experience deciphering java error codes. I'm looking for a few tips on how to work through it and figure out where the problem is. Here is the error I'm getting:

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(
    at controlP5.ControlFont.calculateHeight(Unknown Source)
    at controlP5.ControlFont.adjust(Unknown Source)
    at controlP5.Label$MultilineLabel.draw(Unknown Source)
    at controlP5.Label.draw(Unknown Source)
    at controlP5.ControllerGroup.draw(Unknown Source)
    at controlP5.ControllerGroup.drawControllers(Unknown Source)
    at controlP5.ControllerGroup.draw(Unknown Source)
    at controlP5.ControlWindow.draw(Unknown Source)
    at controlP5.ControlWindow.draw(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at processing.core.PApplet$RegisteredMethods.handle(
    at processing.core.PApplet$RegisteredMethods.handle(
    at processing.core.PApplet.handleMethods(
    at processing.core.PApplet.handleDraw(
    at processing.awt.PSurfaceAWT$12.callDraw(
    at processing.core.PSurfaceNone$


  • You need to provide an MCVE.


  • It seems you read over the end or before beginning of your String array

    It’s caused by substring with error -1

    Something with the parameter is wrong

    Post your entire code or mcve

Sign In or Register to comment.