Processing is responsible for calling the draw()
method 60 times a second (default). Processing also provides methods to change the framerate, enable/disable looping and redraw the screen on demand (when not looping).
When the sketch is launched a pre-processor takes the users source code and wraps it into a class that extends the PApplet class (provided by Processing). So the user’s setup()
and draw()
methods override the ones in PApplet.
Java doesn’t have a native window resize event (at least it didn’t, don’t know about latest versions) letting the OS perform the actual resize, leaving the content to the app. Processing regularly checks the size of window and updates the width
and height
variables.
One thing you might try is to change the default JAVA2D renderer for P2D as they use different window classes
JAVA2D - JFrame
P2D - com.jogamp.newt.opengl.GLWindow