Home>
I want to find out the cause of the exception.
Error messageWhen using tweak mode in the processing editor,
On the 22nd line of the source code below
ArrayIndexOutOfBoundsException
Has come out.
Passing the length of the array raised an exception, so
When the number of arrays was unavoidable, no exception occurred.
In normal rendering execution that is not in tweak mode, no exception occurs in the line,
I was able to describe without problems.
I don't know what caused the exception locally.
Applicable source codenumLabelType1 is a PGraphics type.
numImageType1 is a PImage type.
void makeNumLabel () {
int [] numStrType1and2 = {9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1};// | Single digit label
int labelHType1 = numStrType1and2.length * numDistType1;
/ *
-
-Create Type1 (Numeric label | Large one digit)
-
* /
textFont (HUDFont, fontType1);// --------------------------------- | Decision
int labelWType1 = floor (textWidth ("0"));/// ---------------------- | Label width | Get the character width of "0" (Rounded down)
numLabelType1 = createGraphics (labelWType1, labelHType1, P2D);// | Create image frame and render settings
numLabelType1.beginDraw ();// ------------------------------------ | Draw characters in PGraphics Do
numLabelType1.background (0);// ---------------------------------- | Image Background | Black
numLabelType1.textFont (HUDFont, fontType1);// ------------------- | Determining the font to use and the number of points
numLabelType1.textAlign (LEFT, BASELINE);// ---------------------- | Text alignment | Left/Baseline
numLabelType1.fill (0, 255, 0);// -------------------------------- |
// for (int i = 0;i<= numStrType1and2.length-1;i ++)
for (int i = 0;i<= 23-1;i ++)
{
numLabelType1.text (nf (numStrType1and2 [i], 1), 0, i * -numDistType1 + labelHType1);
}
numLabelType1.endDraw ();// -------------------------------------- |
numImageType1 = numLabelType1.get ();// -------------------------- |
}
Supplemental information (FW/tool version etc.)
processing 3.4
-
Answer # 1
Related articles
- java - i want to eliminate the error that occurs when starting an application that uses jsonic
- java - error occurs in execution path specification with aop in spring
- java - i want to get the key from the value, but illegalstateexception occurs
- java - i want to know the reason why indexoutofboundsexception occurs
- java - an error occurs even if you pass the port number to serversocket [eclipse]
- java - an error occurs even if "-dhttpsprotocols = tlsv12" is added to the command at maven clean
- an error occurs when the code written in the textbook of java is copied to eclips as it is and executed
- java - i want to display an error screen if an error occurs during the update process
- java - an error occurs when adding variables using scanner
- java - sql error occurs while implementing search function in spring
- java - what to do when an overflow occurs
- java - the view is not a child of coordinatorlayout error occurs when executing bottomsheetbehavior
- about error arrayindexoutofboundsexception java
- java - about the cause that hs_err_pid1368log occurs in tomcat server
- java - user registration: an input error occurs and registration is not possible
- java - i want to resolve an error that occurs when running a spring application
- java - error occurs when executing jsp in eclipse
- java - "nullinsteadofmockexception" occurs when executing unit test using mockito
- [java:spring] connection refused occurs in requestgetsession()
- java - on netbeans, an error occurs when opening a moving program from a jar file
Related questions
- java - about arraylist of 2d array
- dealing with javalangnullpointerexception
- java - program to sort in descending order
- java - creating a seat reservation system using an array
- java - a program that displays the number of occurrences of numeric characters that appear in standard input
- java - i get a syntax error on (s), misplaced construct (s) error what should i do? help me
- java - i want to make the 4-choice quiz for super beginners expandable
- java - please tell me the cause of arrayindexoutofboundsexception
- java - i don't know how to extract instance information directly from an array
- java - description when using an array for the return value
Exchanging the order no longer causes an exception.
This function is executed in setup (),
Inside setup (),
I was trying.