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 › PGraphics in JAVA2D
Page Index Toggle Pages: 1
PGraphics in JAVA2D (Read 679 times)
PGraphics in JAVA2D
Mar 1st, 2010, 7:43am
 
Hello Everybody.

I just tried to use PGraphics with the JAVA2D renderer and Processing tells me that:
"processing.core.PGraphicsJava2D needs to be updated for the current release of Processing."

Im using Processing 1.0.9 right now. Does anybody know about a problem with this version in conjunction with PGraphics and JAVA2D?
Re: PGraphics in JAVA2D
Reply #1 - Mar 1st, 2010, 8:25am
 
Are you creating your PGraphics object using the createGraphics() method

Please post the piece of code which is throwing the error, so we can have a look.
Re: PGraphics in JAVA2D
Reply #2 - Mar 1st, 2010, 12:04pm
 
Yes i did. Here is a short version of my code throwing the same error:
Code:
PGraphics pg;

void setup() {
 size(screen.width, screen.height, JAVA2D);

 pg = createGraphics(0,0,JAVA2D);
}

void draw() {
 pg.line(20,20,40,40);
}

Re: PGraphics in JAVA2D
Reply #3 - Mar 1st, 2010, 1:00pm
 
Interesting I just tried your code with the same result. Since I don't know the solution it doesn't help but you know what they say "a problem shared is a problem halved"
Smiley
Re: PGraphics in JAVA2D
Reply #4 - Mar 1st, 2010, 1:56pm
 
pg = createGraphics(0, 0, JAVA2D);

It doesn't make sense to instantiate an empty PGraphics object. I think you may want to use this code instead :

pg = createGraphics(width, height, JAVA2D);
Re: PGraphics in JAVA2D
Reply #5 - Mar 2nd, 2010, 6:22am
 
Thanks antplastik. That is the solution.
Page Index Toggle Pages: 1