FX2D Resizable Window Error

Alright that worked, but now I get a null pointer exception on stage.setResizable(false); because the stage has not been initialized yet. I’ve been putting this code right above setup().

PSurfaceFX surface;
Canvas canvas;
Scene scene;
Stage stage;

@Override
protected PSurface initSurface() {
    surface = (PSurfaceFX) super.initSurface();
    canvas = (Canvas) surface.getNative();
    scene = canvas.getScene();
    stage.setResizable(false);
    return surface;
}

void setup() {
  size(400, 464, FX2D);
1 Like