We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions ›    println("a");
Page Index Toggle Pages: 1
   println("a"); (Read 296 times)
   println("a");
Nov 2nd, 2006, 2:29am
 
Hi,
I'm getting this exception in my code:
Exception in thread "Thread-3" java.lang.NullPointerException
at processing.core.PLine.drawLine_smooth(PLine.java:1062)
and I narrowed it down to this phrase:

   println("a");
   oot.rect(0,0,10,10);  //draw the rect box
   println("b");

a prints, b does not. The program stalls.

Here is part of the code that leads up to this:
   PGraphics oot= createGraphics(int(cWidth*dpi),int(cHeight*dpi),P2D);
   oot.beginDraw();
   oot.background(0,0,0);
   oot.smooth();
   oot.fill(255);
   oot.stroke(0);
   oot.pushMatrix();
   oot.scale(scal);              //scale down
   oot.strokeWeight(1/scal);
   println("a");
   oot.rect(0,0,10,10);  //draw the rect box
   println("b");

This problem began after I updated my code for 118 (from 103 or so). I switched oot from PGraphics2 to PGraphics because it seems there is no PGraphics2 any more as well as some other stuff.
Re:     println("a");
Reply #1 - Nov 2nd, 2006, 11:53am
 
I think that P2D isn't finished yet, and you should use JAVA2D instead until it's completed.
Page Index Toggle Pages: 1