I have NPE problem. I've tried to solve by myself. But...
When I start my processing, usually it runs very well, but very very occasionally NPE occurs, not every time. To find the cause of NPE, I've used
printlnalmost everywhere in my code (I'm not sure whether it's a good way though). Now I guess that it occurs when Gwindow is initializing, because
println("after window");didn't execute. Is it right? Then what should I do?
This
createControlWindow() method is located in void setup.
at processing.core.PApplet.handleDraw(PApplet.java:2301)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:243)
at processing.core.PApplet.run(PApplet.java:2141)
at java.lang.Thread.run(Thread.java:680)
Second question is :
As I've mentioned above I've used
printlnalmost everywhere in my code to find the cause of NPE. Then I've found out that
windowDraw (DrawHandler of Gwindow is called 'windowDraw'.) executes more often than
void draw. Can I make that
windowDraw executes only when
void draw executes? not more not less.
What I've found out is when I remove
for loop, the error doesn't occur. But I really need
for loop to draw things. How can I do? Can I ignore this error????? Actually the program is running though.