i found a nasty little thing which makes some trouble.
But I don’t want to call it a bug because I don’t know where it’s coming from
It would be very helpful to me if someone could explain it.
The following works as expected. The maximize button maximizes the window.
Pressing the button again restores the previous size of the window.
This works with JAVA2D, FX2D, P2D and P3D.
Doing the same with JAVA2D maximizes the window as it should if you press the button once.
But from now on it is impossible to restore the previous size of the window.
It stays maximized.
As you can imagine, this is very annoying.
To me the JAVA2D renderer is the only working option.
The only solution for a correct behaviour I have is using a JPanel inside a JFrame that adds the Processing Canvas to the JPanel.
But then I have to resize the surface myself and it causes the code to be unnecessarily bloated.
Does anyone have an explanation for this?
Thank you in advance!
The console now shows the follwing:
During the creation of the surface there are 6 resize events with an extended state of 0 or NORMAL.
When I try to maximize the window, 3 resize events are fired, also with an extended state of 0.
Since the console is slow, I have printed the results directly to the window.
And now I saw that the extended state was MAXIMIZED_BOTH for a short time and then immediately jumped back to NORMAL.
This is the behaviour of Processing3 and Windows 10.
When i try this on Mac OS X, there is no maximize button in the title bar!
Enlarging and reducing window sizes is one of the basics of a GUI. This should also work in Processing flawlessly
Source code has to be run in Processing version 3.5.4 (I was unable to run in 4.06b due to java.lang.ClassNotFoundException:) and can verify that window does not resize on Mac and resize button is not active in title bar. Modified source code runs ok in IntelliJ. For whatever it’s worth, the window doesn’t look like a 200x200 to me, more like a 120x120; not sure setting() even works. You can set it to 800x800 and it stays the same size.
For whatever it’s worth, you can run a blank sketch in 3.5.4 and get the same result. I can’t see that your posted code does anything; the default window is displayed in 3.5.4 but the FX2D renderer also does nothing on my Mac system. Console message states: The type TestWindow is never used locally.
And it seems that something goes wrong with my LookAndFeel implementation (which is not included in the example code).
So I need to find out what’s wrong…