How to minimize Processing Sketch window?

Is there a way to run a line of code similar to exit(); that will minimize the window instead of closing it like exit(); does?

I need the window to go away so another can take its place. It just still needs to exist to listen for Arduino communication.


1 Like

frame.setExtendedState(JFrame.MAXIMIZED_BOTH); frame.setVisible(true);

Try something like this

1 Like

JFrame jframe = (JFrame)((processing.awt.PSurfaceAWT.SmoothCanvas)getSurface().getNative()).getFrame();
jframe.setExtendedState(jframe.getExtendedState() | jframe.ICONIFIED);

Works ok on my system. Thanks.