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.
Page Index Toggle Pages: 1
HowTo on the eclipse ? (Read 2114 times)
HowTo on the eclipse ?
Apr 30th, 2007, 5:03pm
 
Hello,

I am trying to build a library for Processing, and test it on the eclipse.
When I was going to register dispose() in a constructer, I received the following exception.

Code:
java.lang.NullPointerException
at processing.core.PApplet.registerNoArgs(PApplet.java:737)
:
java.lang.RuntimeException: Could not register dispose + () for wrj4P5.Wrj4P5@c53dce
at processing.core.PApplet.die(PApplet.java:2292)
:


Code:
import processing.core.*;
import wrj4P5.*;
public class TestImpl extends PApplet {
public Wrj4P5 wii=new Wrj4P5(this);
public void setup() {
}
public void draw() {
line(10,10,160,120);
}

Code:
package wrj4P5;
import processing.core.*;
public class Wrj4P5 {
PApplet parent;
public Wrj4P5(PApplet parent) {
this.parent = parent;
parent.registerDispose(this);
}
public void dispose() {
}
}


Will the approach that I take be wrong? If there is good advice to improve this situation, I ask.

Thanks
Re: HowTo on the eclipse ?
Reply #1 - May 1st, 2007, 8:03am
 
Code:

import processing.core.*;
import wrj4P5.*;
public class TestImpl extends PApplet {
public Wrj4P5 wii;
public void setup() {
wii=new Wrj4P5(this);
}
public void draw() {
line(10,10,160,120);
}
}


you should make sure that you put all initialization code inside a function. setup() is a good place for example.

F
Re: HowTo on the eclipse ?
Reply #2 - May 1st, 2007, 2:03pm
 
Thank you fjen.

That was my one-sided belief.

I understand now.
Page Index Toggle Pages: 1