diff --git a/core/src/processing/core/PSurfaceAWT.java b/core/src/processing/core/PSurfaceAWT.java index b5594d450..d40e2bda3 100644 --- a/core/src/processing/core/PSurfaceAWT.java +++ b/core/src/processing/core/PSurfaceAWT.java @@ -831,9 +831,13 @@ public class PSurfaceAWT implements PSurface { // canvas.setSize(wide, high); // frame.setSize(wide, high); - setFrameSize(); //wide, high); + if (frame != null) { // canvas only + setFrameSize(); //wide, high); + } setCanvasSize(); - frame.setLocationRelativeTo(null); + if (frame != null) { + frame.setLocationRelativeTo(null); + } GraphicsConfiguration gc = canvas.getGraphicsConfiguration(); // If not realized (off-screen, i.e the Color Selector Tool), gc will be null.