Hello,
I get a "NullPointerException" running the following code:
int[][] MyArray = new int[5][8];
void setup() {
size(100, 100);
noLoop();
}
void draw() {
MyArray = (int[][]) expand(MyArray);
MyArray[0] = (int[]) expand(MyArray[0]);
println(MyArray.length); // 10 -> expected
println(MyArray[0].length); // 16 -> expected
MyArray [2][5] = 34;
println(MyArray[0] [5]); // 0 -> ??
MyArray [8] [10] =41; // Null Pointer Exception
}
It seems to me I have to instanciate the expanded array. But how to do (without loosing the data of the original array)?
Thanks in advance for any kind of help!
Carlos
Hello,
sending information to the canvas from the next lower level of draw(), how can I get an actualization of the canvas immediately?
I try to visualize data from the iterations of a bubble-sort. When actualizing from draw(), everything is fine, but when I try the same from inside the Bubble-routine whch is called in draw(), I only get an actualization returning to the draw()-function. What can I do?