Hey, I met a problem while I want to run the applet of prcessing thing in my normal java application.
So here is the definition of my processing part:
import processing.core.*;
import wordcram.*;
public class CasWordCram extends PApplet {
/**
*
*/
WordCram words = new WordCram(this);
@Override
public void setup() {
System.out.println("hello++++++++++&&&&&&&****************");
this.size(500, 400);
this.background(255);
this.words.fromWebPage("http://en.wikipedia.org/wiki/Word_cloud");
this.words.drawAll();
this.save("test");
}
}
//So the thing above is running perfectly and I can get the applet window which is fine. (ONLY RUN IT AS A JAVA APPLET INDEPENDENTLY).
public void finishProcessing() {
CasWordCram wordcram = new CasWordCram();
wordcram.setup();
}
//So this function above is defined in a normal java application. It's under one class. And I built the wordcram class from the defined class above.
But after compiling it as JAVA APPLICATION. it shows this error:
Exception in thread "main" java.lang.NullPointerException
at processing.core.PApplet.size(Unknown Source)
at processing.core.PApplet.size(Unknown Source)
at de.fhg.iais.kd.tm.quote.casAnnotation.CasWordCram.setup(CasWordCram.java:21)
Can somebody help me with this? I got stuck by this for hours......Thank you for your patient reading~~
So here is the definition of my processing part:
import processing.core.*;
import wordcram.*;
public class CasWordCram extends PApplet {
/**
*
*/
WordCram words = new WordCram(this);
@Override
public void setup() {
System.out.println("hello++++++++++&&&&&&&****************");
this.size(500, 400);
this.background(255);
this.words.fromWebPage("http://en.wikipedia.org/wiki/Word_cloud");
this.words.drawAll();
this.save("test");
}
}
//So the thing above is running perfectly and I can get the applet window which is fine. (ONLY RUN IT AS A JAVA APPLET INDEPENDENTLY).
public void finishProcessing() {
CasWordCram wordcram = new CasWordCram();
wordcram.setup();
}
//So this function above is defined in a normal java application. It's under one class. And I built the wordcram class from the defined class above.
But after compiling it as JAVA APPLICATION. it shows this error:
Exception in thread "main" java.lang.NullPointerException
at processing.core.PApplet.size(Unknown Source)
at processing.core.PApplet.size(Unknown Source)
at de.fhg.iais.kd.tm.quote.casAnnotation.CasWordCram.setup(CasWordCram.java:21)
Can somebody help me with this? I got stuck by this for hours......Thank you for your patient reading~~
1