How do I change the size of the display window?

  • The file “CanvasResizeWatcher.java” is itself the library.
  • Just create a new file tab on the Processing IDE (PDE) w/ that exactly name w/o forgetting its “.java” extension.
  • Then copy & paste the contents of that file from the Gist repo onto the new “.java” tab.
  • Use import gotoloop.listener.CanvasResizeWatcher; in order to use its main top class.
  • Basically it automatically calls back our own frameResized() every time the sketch’s window changes its dimensions.
  • The file “Canvas_Resize_Watcher.pde” has an example on how to define our own frameResized() callback.

As stated already the library “CanvasResizeWatcher.java” got code on how to apply the window object returned by PSurface::getNative() for each of the 4 Processing renderers (JAVA2D, FX2D, P2D, P3D).