how to initialize PApplet
in
Android Processing
•
2 years ago
I want to use methods in PApplet, but do not want to create a class extending PApplet.
Here is my code:
public class TestMain {
public static void main(String args[]){
PApplet pa = new PApplet();
pa.size(200,200);
}
}
An error happends for the line
pa.size(200,200) .
Exception in thread "main" java.lang.NullPointerException
at processing.core.PApplet.size(Unknown Source)
at processing.core.PApplet.size(Unknown Source)
at processing.core.PApplet.size(Unknown Source)
at processing.core.PApplet.size(Unknown Source)
I think it maybe because the initialization of PApplet is not correct, but I do not know to solve it.
Does anyone know how to solve it? Thanks!
1