oulaoups / controlp5

Automatically exported from code.google.com/p/controlp5
0 stars 0 forks source link

Setting ControlFont on initialize controlP5 cause a null pointer exception #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Write following code
import controlP5.*;

ControlP5 cp5;

void setup() {
  size(100,100);
  cp5 = new ControlP5(this, new ControlFont(createFont("Ubuntu", 12)));
}

void draw() {
}

2. Run the code

3. Following error is shown
Exception in thread "Animation Thread" java.lang.NullPointerException
    at controlP5.ControlP5.updateFont(Unknown Source)
    at controlP5.ControlP5.setFont(Unknown Source)
    at controlP5.ControlP5.<init>(Unknown Source)
    at sketch_121015b.setup(sketch_121015b.java:29)
    at processing.core.PApplet.handleDraw(PApplet.java:2103)
    at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:190)
    at processing.core.PApplet.run(PApplet.java:2006)
    at java.lang.Thread.run(Thread.java:722)

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
- Processing 2.0 Beta 3
- ControlP5 2.0.1
- Ubuntu 12.4

Please provide any additional information below.

Original issue reported on code.google.com by iwan.san...@gmail.com on 15 Oct 2012 at 1:39

GoogleCodeExporter commented 9 years ago
I temporary use following workaround:
Calling setFont() after initialize ControlP5 without setting the ControlFont

cp5 = new ControlP5(this);
cp5.setFont(aControlFont);

Original comment by iwan.san...@gmail.com on 15 Oct 2012 at 6:36

GoogleCodeExporter commented 9 years ago

Original comment by soj...@gmail.com on 17 Oct 2012 at 10:20

GoogleCodeExporter commented 9 years ago

Original comment by soj...@gmail.com on 23 Dec 2012 at 4:32