There is nothing built into G4P that would allow you to do that for you.
You would need to access the underlying window container object to have a chance of changing the icon.
If you are using Processing V2 then all windows are created using JFrame no matter which renderer (JAVA2D, P2D or P3D) you use. In V3 that is only true for JAVA2D. The renderers P2D and P3D use the com.jogamp.newt.opengl.GLWindow class.
So in Processing 3 and you have created a GWindow (secondary window) called window you can get the window's container object with
Answers
There is nothing built into G4P that would allow you to do that for you.
You would need to access the underlying window container object to have a chance of changing the icon.
If you are using Processing V2 then all windows are created using JFrame no matter which renderer (JAVA2D, P2D or P3D) you use. In V3 that is only true for JAVA2D. The renderers P2D and P3D use the com.jogamp.newt.opengl.GLWindow class.
So in Processing 3 and you have created a GWindow (secondary window) called
window
you can get the window's container object withJAVA2D (default)
P2D/P3D
The next stage is to do some googling to find out how to use these to change the icon. I let you try that.
If you think that this is a useful feature to include with G4P you can add a ticket here but it will be some time before I can do anything about it.
https://forum.Processing.org/two/discussion/20405/how-to-change-the-window-icon
Thanks! Helped a lot.