We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi!
I am using processing in eclipse and I am trying to use CreateFont()
, but I keep getting a NullPointerException
.
This is my code;
private InfoPanel() {
File font = new File("src\\cour.ttf");
String str = font.getAbsolutePath();
infoFont = p.createFont("src/cour.ttf", 12, false);
}
Where 'p' is the main PApplet
.
What I have already done;
Originally I wanted to use loadFont()
instead but that did not work either (Have done the same with it as the list above).
It should also be noted that;
PApplet
, but does not import it (thus the 'p.');Any help is welcome, thank you.
Answers
Remember, boys and girls, to never set your
PApplet p
tonull
and pretend everything is fine.Mods, if you do not want to keep this, you are welcome to delete it.
Really, you set an instance of PApplet to null?
Thank you for sharing the lesson learned, @MrLumme !